Skip to content

Instantly share code, notes, and snippets.

@akullpp
Created October 1, 2023 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akullpp/f5ea30d8cafd5ebb13da9f2918ba52b7 to your computer and use it in GitHub Desktop.
Save akullpp/f5ea30d8cafd5ebb13da9f2918ba52b7 to your computer and use it in GitHub Desktop.
ECR Lifecycle Policy
{
"rules": [
{
"action": {
"type": "expire"
},
"selection": {
"countType": "imageCountMoreThan",
"countNumber": 3,
"tagStatus": "tagged",
"tagPrefixList": [
"development"
]
},
"description": "Keep at least the development image",
"rulePriority": 10
},
{
"rulePriority": 20,
"description": "Remove images older than 90 days",
"selection": {
"tagStatus": "any",
"countType": "sinceImagePushed",
"countUnit": "days",
"countNumber": 30
},
"action": {
"type": "expire"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment