Skip to content

Conversation

@maxsonferovante
Copy link
Contributor

  • 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)
@maxsonferovante maxsonferovante self-assigned this Dec 6, 2025
@github-actions
Copy link

github-actions bot commented Dec 6, 2025

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.

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

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.

@maxsonferovante maxsonferovante merged commit 4fa00cd into main Dec 6, 2025
2 checks passed
@maxsonferovante maxsonferovante deleted the feature/ecr-lifecycle-policy-optimization branch December 6, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants