Skip to content

Commit

Permalink
Merge branch 'fix/ecr-lifecycle-policy-update' of https://github.com/…
Browse files Browse the repository at this point in the history
…connext/nxtp into feat/better-ecr-image-tagging
  • Loading branch information
carlomazzaferro committed Oct 9, 2023
2 parents d8c3070 + 9f24285 commit 0a6e7fa
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions ops/modules/ecr/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,52 @@ resource "aws_ecr_lifecycle_policy" "remove_old_images" {
"rules": [
{
"rulePriority": 1,
"description": "Expire images older than 20 days",
"description": "Expire main images that are not the last 50",
"selection": {
"tagStatus": "any",
"tagStatus": "tagged",
"tagPrefixList": ["main-"],
"countType": "imageCountMoreThan",
"countNumber": 50
},
"action": {
"type": "expire"
}
},
{
"rulePriority": 2,
"description": "Expire staging images that are not the last 20",
"selection": {
"tagStatus": "tagged",
"tagPrefixList": ["staging-"],
"countType": "imageCountMoreThan",
"countNumber": 20
},
"action": {
"type": "expire"
}
},
{
"rulePriority": 3,
"description": "Expire prod images that are not the last 5",
"selection": {
"tagStatus": "tagged",
"tagPrefixList": ["prod-"],
"countType": "imageCountMoreThan",
"countNumber": 5
},
"action": {
"type": "expire"
}
},
{
"rulePriority": 4,
"description": "Expire images older than 60 days",
"selection": {
"tagStatus": "tagged",
"tagPrefixList": ["main-", "staging-", "prod-"],
"countType": "sinceImagePushed",
"countUnit": "days",
"countNumber": 20
"countNumber": 180
},
"action": {
"type": "expire"
Expand Down

0 comments on commit 0a6e7fa

Please sign in to comment.