mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-30 13:10:56 +00:00
add ecr life cycle
This commit is contained in:
parent
e316b2005b
commit
60b30a49ac
1 changed files with 7 additions and 6 deletions
|
|
@ -25,6 +25,7 @@ resource "aws_ecr_repository_policy" "extractor_loader_ecr_access" {
|
|||
}
|
||||
|
||||
|
||||
# ECR lifecycle policy to delete tagged images older than 14 days
|
||||
resource "aws_ecr_lifecycle_policy" "extractor_loader_lifecycle" {
|
||||
repository = aws_ecr_repository.extractor_and_loader.name
|
||||
|
||||
|
|
@ -34,11 +35,11 @@ resource "aws_ecr_lifecycle_policy" "extractor_loader_lifecycle" {
|
|||
rulePriority = 1
|
||||
description = "Delete tagged images older than 14 days"
|
||||
selection = {
|
||||
tagStatus = "tagged"
|
||||
countType = "sinceImagePushed"
|
||||
countUnit = "days"
|
||||
countNumber = 14
|
||||
# Remove tagPrefixList to apply to all tagged images
|
||||
tagStatus = "tagged"
|
||||
countType = "sinceImagePushed"
|
||||
countUnit = "days"
|
||||
countNumber = 5
|
||||
tagPrefixList = [""] # Matches all tagged images
|
||||
}
|
||||
action = {
|
||||
type = "expire"
|
||||
|
|
@ -46,4 +47,4 @@ resource "aws_ecr_lifecycle_policy" "extractor_loader_lifecycle" {
|
|||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue