Hello guys as we all know that there's a limit on storing images on ECR and that's why we want to keep only last 4 images on ECR. Any leads would be appreciated.
You can use ECR Lifecycle Policies to delete all but the last 4 images with the following policy:
{
"rules": [
{
"rulePriority": 1,
"description": "Rule 1",
"selection": {
"tagStatus": "any",
"countType": "imageCountMoreThan",
"countNumber": 4
},
"action": {
"type": "expire"
}
}
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With