mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-06-08 11:17:29 +00:00
terraform policy
This commit is contained in:
parent
8fe3938116
commit
95aad5c78f
2 changed files with 27 additions and 14 deletions
|
|
@ -30,20 +30,33 @@ resource "aws_ecr_lifecycle_policy" "extractor_loader_lifecycle" {
|
|||
repository = aws_ecr_repository.extractor_and_loader.name
|
||||
|
||||
policy = jsonencode({
|
||||
rules = [
|
||||
{
|
||||
rulePriority = 1
|
||||
description = "Delete tagged images older than 14 days"
|
||||
selection = {
|
||||
tagStatus = "tagged"
|
||||
countType = "sinceImagePushed"
|
||||
countUnit = "days"
|
||||
countNumber = 5
|
||||
"rules": [
|
||||
{
|
||||
"rulePriority": 2,
|
||||
"description": "Expire images older than 14 days",
|
||||
"selection": {
|
||||
"tagStatus": "untagged",
|
||||
"countType": "sinceImagePushed",
|
||||
"countUnit": "days",
|
||||
"countNumber": 1
|
||||
},
|
||||
"action": {
|
||||
"type": "expire"
|
||||
}
|
||||
},
|
||||
{
|
||||
"rulePriority": 1,
|
||||
"description": "Keep last 5 images",
|
||||
"selection": {
|
||||
"tagStatus": "tagged",
|
||||
"tagPrefixList": ["feature"],
|
||||
"countType": "imageCountMoreThan",
|
||||
"countNumber": 5
|
||||
},
|
||||
"action": {
|
||||
"type": "expire"
|
||||
}
|
||||
}
|
||||
action = {
|
||||
type = "expire"
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ resource "aws_ecr_repository_policy" "lambda_example_ecr_access" {
|
|||
}
|
||||
|
||||
# ECR lifecycle policy to delete tagged images older than 14 days
|
||||
resource "aws_ecr_lifecycle_policy" "extractor_loader_lifecycle" {
|
||||
resource "aws_ecr_lifecycle_policy" "lambda_example_ecr_lifecycle" {
|
||||
repository = aws_ecr_repository.lambda_example.name
|
||||
|
||||
policy = jsonencode({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue