From cc76f8502bb947012ae27fb58d8073d9943e2de2 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 2 Feb 2026 18:40:15 +0000 Subject: [PATCH] deploy container registry --- .github/workflows/deploy_terraform.yml | 10 +++++----- infrastructure/terraform/modules/ecr/main.tf | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index d90d9912..51d7599e 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -57,8 +57,8 @@ jobs: cd infrastructure/terraform/shared terraform plan -var-file=dev.tfvars - # # only run once - # - name: Terraform Apply (shared) - # run: | - # cd infrastructure/terraform/shared - # terraform apply -auto-approve -var-file=dev.tfvars \ No newline at end of file + # only run once + - name: Terraform Apply (shared) + run: | + cd infrastructure/terraform/shared + terraform apply -auto-approve -var-file=dev.tfvars \ No newline at end of file diff --git a/infrastructure/terraform/modules/ecr/main.tf b/infrastructure/terraform/modules/ecr/main.tf index dfed0712..51085c5c 100644 --- a/infrastructure/terraform/modules/ecr/main.tf +++ b/infrastructure/terraform/modules/ecr/main.tf @@ -25,14 +25,14 @@ resource "aws_ecr_lifecycle_policy" "my_repository_policy" { } }, - # 2️⃣ Expire everything else beyond the most recent 20 images + # 2️⃣ Expire everything else beyond the most recent 10 images { rulePriority = 2 - description = "Expire old non-protected images" + description = "Retain only the last 10 images" -> "Keep prod, main, dev images forever" selection = { tagStatus = "any" countType = "imageCountMoreThan" - countNumber = 20 + countNumber = 10 } action = { type = "expire"