Skip to content

fix(ecr): retain main builds with the correct tag prefix - #190

Merged
Alexanderamiri merged 1 commit into
mainfrom
fix/ecr-main-tag-retention
Nov 10, 2026
Merged

Alexanderamiri merged 1 commit into
mainfrom
fix/ecr-main-tag-retention

Conversation

@tanettrimas

Copy link
Copy Markdown
Member

Summary

  • Change the main-build lifecycle selector from [\"main-\", \"master-\"] to [\"main-\"].
  • Update the variable description and module documentation to reflect main-only retention.

Why

ECR requires every prefix in tagPrefixList to match a tag on the same image (AND semantics). The existing selector therefore requires both a main- and a master- tag. Normal main builds do not match and are instead eligible for the catch-all expiration rule after seven days by default.

With this fix, the newest main_keep_count main-build images (three by default) are protected from the lower-priority age-based rule.

AWS evaluation rules: https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html#lp_evaluation_rules

Validation

  • git diff --check passed.
  • terraform fmt -check terraform/modules/ecr-repo could not run because Terraform is not installed locally.

Deployment

Apply Terraform through the usual deployment workflow to update the live ECR lifecycle policy.

@tanettrimas
tanettrimas requested a review from a team as a code owner November 10, 2026 11:55
@github-actions

Copy link
Copy Markdown

Terraform Plan

✅ No changes — infrastructure is up to date.

Plan output
Acquiring state lock. This may take a few moments...
aws_ssm_parameter.atlassian_org_id: Refreshing state... [id=/javabin/platform/atlassian-org-id]
aws_ssm_parameter.atlassian_api_key: Refreshing state... [id=/javabin/platform/atlassian-api-key]

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.

@Kullsyreholdig
Kullsyreholdig self-requested a review November 10, 2026 11:57

@Kullsyreholdig Kullsyreholdig left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Kullsyreholdig
Kullsyreholdig self-requested a review November 10, 2026 11:59

@Kullsyreholdig Kullsyreholdig left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Alexanderamiri
Alexanderamiri merged commit 200621d into main Nov 10, 2026
4 checks passed
@Alexanderamiri
Alexanderamiri deleted the fix/ecr-main-tag-retention branch November 10, 2026 12:00
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.

3 participants