Skip to content

Instantly share code, notes, and snippets.

@shcallaway
Last active February 1, 2021 22:01
Show Gist options
  • Save shcallaway/82b34a28ced2098757ca72923df1a1d7 to your computer and use it in GitHub Desktop.
Save shcallaway/82b34a28ced2098757ca72923df1a1d7 to your computer and use it in GitHub Desktop.
Lifecycle policy that caps prod and stage images at 25 each and all others at 75 for a total of 125
{
"rules": [
{
"rulePriority": 10,
"description": "Cap production images at 25.",
"selection": {
"tagStatus": "tagged",
"countType": "imageCountMoreThan",
"tagPrefixList": [
"prod"
],
"countNumber": 25
},
"action": {
"type": "expire"
}
},
{
"rulePriority": 20,
"description": "Cap stage images at 25.",
"selection": {
"tagStatus": "tagged",
"countType": "imageCountMoreThan",
"tagPrefixList": [
"stage"
],
"countNumber": 25
},
"action": {
"type": "expire"
}
},
{
"rulePriority": 30,
"description": "Cap all images at 75.",
"selection": {
"tagStatus": "any",
"countType": "imageCountMoreThan",
"countNumber": 75
},
"action": {
"type": "expire"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment