{
"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
}
]
}
AWS ECR 이미지를 자동으로 지워주는 라이프사이클을 작성해두어야 한다.
나는 태그에 prod, alpha 를 사용하기에 이렇게 작성하였다.
이걸 추가해놓기만하면, 알아서 태깅에 맞는 이미지라면 삭제 처리해준다.