-
Notifications
You must be signed in to change notification settings - Fork 1
feat: otimiza política de ciclo de vida ECR para manter apenas 1 imag… #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maxsonferovante
merged 1 commit into
main
from
feature/ecr-lifecycle-policy-optimization
Dec 6, 2025
Merged
feat: otimiza política de ciclo de vida ECR para manter apenas 1 imag… #52
maxsonferovante
merged 1 commit into
main
from
feature/ecr-lifecycle-policy-optimization
Dec 6, 2025
Conversation
This file contains hidden or 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
Contributor
maxsonferovante
commented
Dec 6, 2025
- Implementa limpeza automática de imagens não-taggeadas
- Mantém apenas a versão mais recente de cada tag específica
- Reduz fallback de segurança para 1 dia para máxima economia
- Aplica política consistente nos 3 repositórios (API, Builder, Notification)
…em por tag - Implementa limpeza automática de imagens não-taggeadas - Mantém apenas a versão mais recente de cada tag específica - Reduz fallback de segurança para 1 dia para máxima economia - Aplica política consistente nos 3 repositórios (API, Builder, Notification)
Terraform Plan (shared)No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed. |
Terraform Plan (dev)Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# module.ecr.aws_ecr_lifecycle_policy.api_repository_policy must be replaced
-/+ resource "aws_ecr_lifecycle_policy" "api_repository_policy" {
~ id = "tech-floripa-certificates-api-dev" -> (known after apply)
~ policy = jsonencode(
~ {
~ rules = [
~ {
~ description = "Manter apenas as últimas 1 imagens para otimizar custos" -> "Remove imagens não-taggeadas imediatamente (exceto a mais recente)"
# (3 unchanged attributes hidden)
},
~ {
~ description = "Manter apenas as últimas 1 imagens taggeadas" -> "Mantém apenas 1 imagem por tag específica - remove versões antigas"
~ selection = {
~ tagPrefixList = [
# (4 unchanged elements hidden)
"staging",
+ "main",
]
# (3 unchanged attributes hidden)
}
# (2 unchanged attributes hidden)
},
+ {
+ action = {
+ type = "expire"
}
+ description = "Remove qualquer imagem taggeada com mais de 1 dias (fallback de segurança)"
+ rulePriority = 3
+ selection = {
+ countNumber = 1
+ countType = "sinceImagePushed"
+ countUnit = "days"
+ tagStatus = "tagged"
}
},
]
} # forces replacement
)
~ registry_id = "334318883918" -> (known after apply)
# (2 unchanged attributes hidden)
}
# module.ecr.aws_ecr_lifecycle_policy.builder_repository_policy must be replaced
-/+ resource "aws_ecr_lifecycle_policy" "builder_repository_policy" {
~ id = "tech-floripa-certificates-builder-dev" -> (known after apply)
~ policy = jsonencode(
~ {
~ rules = [
~ {
~ description = "Manter apenas as últimas 1 imagens para otimizar custos" -> "Remove imagens não-taggeadas imediatamente (exceto a mais recente)"
# (3 unchanged attributes hidden)
},
~ {
~ description = "Manter apenas as últimas 1 imagens taggeadas" -> "Mantém apenas 1 imagem por tag específica - remove versões antigas"
~ selection = {
~ tagPrefixList = [
# (4 unchanged elements hidden)
"staging",
+ "main",
]
# (3 unchanged attributes hidden)
}
# (2 unchanged attributes hidden)
},
+ {
+ action = {
+ type = "expire"
}
+ description = "Remove qualquer imagem taggeada com mais de 1 dias (fallback de segurança)"
+ rulePriority = 3
+ selection = {
+ countNumber = 1
+ countType = "sinceImagePushed"
+ countUnit = "days"
+ tagStatus = "tagged"
}
},
]
} # forces replacement
)
~ registry_id = "334318883918" -> (known after apply)
# (2 unchanged attributes hidden)
}
# module.ecr.aws_ecr_lifecycle_policy.notification_repository_policy must be replaced
-/+ resource "aws_ecr_lifecycle_policy" "notification_repository_policy" {
~ id = "tech-floripa-certificates-notification-dev" -> (known after apply)
~ policy = jsonencode(
~ {
~ rules = [
~ {
~ description = "Manter apenas as últimas 1 imagens para otimizar custos" -> "Remove imagens não-taggeadas imediatamente (exceto a mais recente)"
# (3 unchanged attributes hidden)
},
~ {
~ description = "Manter apenas as últimas 1 imagens taggeadas" -> "Mantém apenas 1 imagem por tag específica - remove versões antigas"
~ selection = {
~ tagPrefixList = [
# (4 unchanged elements hidden)
"staging",
+ "main",
]
# (3 unchanged attributes hidden)
}
# (2 unchanged attributes hidden)
},
+ {
+ action = {
+ type = "expire"
}
+ description = "Remove qualquer imagem taggeada com mais de 1 dias (fallback de segurança)"
+ rulePriority = 3
+ selection = {
+ countNumber = 1
+ countType = "sinceImagePushed"
+ countUnit = "days"
+ tagStatus = "tagged"
}
},
]
} # forces replacement
)
~ registry_id = "334318883918" -> (known after apply)
# (2 unchanged attributes hidden)
}
Plan: 3 to add, 0 to change, 3 to destroy. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.