From 797eb0596b30dc68fa54df72e6a71186a461bc9b Mon Sep 17 00:00:00 2001 From: shri Date: Thu, 8 Aug 2024 22:09:45 +0200 Subject: [PATCH] Add ecr module to main --- deploy/aws/tf/main.tf | 6 ++++++ deploy/aws/tf/modules/ecr/main.tf | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/deploy/aws/tf/main.tf b/deploy/aws/tf/main.tf index 67099112..2528f62b 100644 --- a/deploy/aws/tf/main.tf +++ b/deploy/aws/tf/main.tf @@ -47,6 +47,12 @@ module "alb" { security_groups = [module.vpc.alb_security_group_id] } +module "ecr" { + source = "./modules/ecr" + app_name = var.app_name + environment = var.environment +} + module "ecs" { source = "./modules/ecs" app_name = var.app_name diff --git a/deploy/aws/tf/modules/ecr/main.tf b/deploy/aws/tf/modules/ecr/main.tf index aefd2bb7..fdacbaf0 100644 --- a/deploy/aws/tf/modules/ecr/main.tf +++ b/deploy/aws/tf/modules/ecr/main.tf @@ -1,10 +1,14 @@ # tf/modules/ecr/main.tf resource "aws_ecr_repository" "app_repository" { - name = "${var.app_name}-app-repository-${var.environment}" + name = "${var.app_name}-repository-${var.environment}" + + image_scanning_configuration { + scan_on_push = true + } tags = { - Name = "${var.app_name}-app-repository-${var.environment}" + Name = "${var.app_name}-repository-${var.environment}" Environment = var.environment } }