Setting Up an AWS ECR Lifecycle
You need to create a lifecycle policy to automatically delete AWS ECR images. I use prod and alpha as tags, so I wrote it this way. Once you add this, it will a
GGAMI
{
"rules": [
{
"action": {
"type": "expire"
},
"selection": {
"countType": "imageCountMoreThan",
"countNumber": 3,
"tagStatus": "tagged",
"tagPrefixList": [
"prod"
]
},
"description": "prod delete",
"rulePriority": 2
},
{
"action": {
"type": "expire"
},
"selection": {
"countType": "imageCountMoreThan",
"countNumber": 3,
"tagStatus": "tagged",
"tagPrefixList": [
"alpha"
]
},
"description": "alpha delete",
"rulePriority": 3
}
]
}