Last active
November 15, 2024 09:58
-
-
Save xiaket/b16623765e11a657cbe52b61f1aeda8d to your computer and use it in GitHub Desktop.
ECR Lifecycle Policy example with explanations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": [ | |
{ | |
"rulePriority": 10, | |
"description": "For `latest` tag, keep last 5 images", | |
"selection": { | |
"tagStatus": "tagged", | |
"tagPrefixList": ["latest"], | |
"countType": "imageCountMoreThan", | |
"countNumber": 5 | |
}, | |
"action": { "type": "expire" } | |
}, | |
{ | |
"rulePriority": 20, | |
"description": "For `master` tag, keep last 5 images", | |
"selection": { | |
"tagStatus": "tagged", | |
"tagPrefixList": ["master"], | |
"countType": "imageCountMoreThan", | |
"countNumber": 5 | |
}, | |
"action": { "type": "expire" } | |
}, | |
{ | |
"rulePriority": 990, | |
"description": "Only keep untagged images for 7 days", | |
"selection": { | |
"tagStatus": "untagged", | |
"countType": "sinceImagePushed", | |
"countUnit": "days", | |
"countNumber": 7 | |
}, | |
"action": { "type": "expire" } | |
}, | |
{ | |
"rulePriority": 1000, | |
"description": "Only keep tagged images for 15 days", | |
"selection": { | |
"tagStatus": "any", | |
"countType": "sinceImagePushed", | |
"countUnit": "days", | |
"countNumber": 15 | |
}, | |
"action": { "type": "expire" } | |
} | |
] | |
} |
What do you mean under protected ones? Which images are protected and by whom?
The protected ones are those listed in 1 and 2.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What do you mean under protected ones? Which images are protected and by whom?