From 0724f5bd32fc0299b1a88d8eb7ef4c3717d3f290 Mon Sep 17 00:00:00 2001 From: James Robinson <70377025+JamesPRobinson@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:24:23 +0000 Subject: [PATCH 1/2] fix/must provide tag pattern when tag_status = 'tagged' in ecr lifecycle rule --- infra/ecr.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/infra/ecr.tf b/infra/ecr.tf index 3fdafc5..75428da 100644 --- a/infra/ecr.tf +++ b/infra/ecr.tf @@ -299,6 +299,7 @@ data "aws_ecr_lifecycle_policy_document" "keep_last_five_releases" { priority = 2 selection { tag_status = "tagged" + tag_pattern_list = ["*"] count_type = "imageCountMoreThan" count_number = 5 } From 7fe1e675b94c9814d88e9cbae4cb9f4e1e786445 Mon Sep 17 00:00:00 2001 From: James Robinson <70377025+JamesPRobinson@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:47:09 +0000 Subject: [PATCH 2/2] Update ecr.tf --- infra/ecr.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infra/ecr.tf b/infra/ecr.tf index 75428da..81ec48b 100644 --- a/infra/ecr.tf +++ b/infra/ecr.tf @@ -298,10 +298,10 @@ data "aws_ecr_lifecycle_policy_document" "keep_last_five_releases" { rule { priority = 2 selection { - tag_status = "tagged" + tag_status = "tagged" tag_pattern_list = ["*"] - count_type = "imageCountMoreThan" - count_number = 5 + count_type = "imageCountMoreThan" + count_number = 5 } } # ... and just in case we somehow end up with untagged images, expire them after 1 day