Created
February 19, 2022 07:05
-
-
Save dev-daeun/27626fc08ad7848f23975bf94413fc1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_ecr_lifecycle_policy" "ecr-lifecycle-policy" { | |
repository = aws_ecr_repository.ecr-repo.name | |
policy = jsonencode({ | |
rules = [ | |
{ | |
rulePriority = 1, | |
description = "Expire images older than 30 days", | |
selection = { | |
tagStatus = "any", | |
countType = "sinceImagePushed", | |
countUnit = "days", | |
countNumber = 30 | |
} | |
action = { | |
type = "expire" | |
} | |
} | |
] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment