Terrafrom resource: aws ecr lifecycle policy
(Redirected from Aws ecr lifecycle policy)
Jump to navigation
Jump to search
aws_ecr_lifecycle_policy (tf.io)
resource "aws_ecr_repository" "foo" {
name = "bar"
}
resource "aws_ecr_lifecycle_policy" "foopolicy" {
repository = aws_ecr_repository.foo.name
policy = <<EOF
{
"rules": [
{
"rulePriority": 1,
"description": "Expire images older than 14 days",
"selection": {
"tagStatus": "untagged",
"countType": "sinceImagePushed",
"countUnit": "days",
"countNumber": 14
},
"action": {
"type": "expire"
}
}
]
}
EOF
}
See also[edit]
Advertising: