Skip to content

Commit 1d766ef

Browse files
authored
feat: change ecr lifecycle policy to keep images at least 7 days (#179)
1 parent 56e6273 commit 1d766ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ecr.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ data "aws_ecr_lifecycle_policy_document" "lifecycle" {
4646

4747
rule {
4848
priority = 40
49+
description = "Keep images for 7 days"
50+
selection {
51+
count_type = "sinceImagePushed"
52+
count_unit = "days"
53+
tag_status = "tagged"
54+
tag_pattern_list = ["*"]
55+
count_number = 7
56+
}
57+
action {
58+
type = "expire"
59+
}
60+
}
61+
62+
rule {
63+
priority = 50
4964
description = "Keep last 30 images"
5065
selection {
5166
count_number = 30

0 commit comments

Comments
 (0)