-
Notifications
You must be signed in to change notification settings - Fork 9.8k
feat(ecr): Add support for IMMUTABLE_WITH_EXCLUSION image tag mutability #43642
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
feat(ecr): Add support for IMMUTABLE_WITH_EXCLUSION image tag mutability #43642
Conversation
This commit adds support for the IMMUTABLE_WITH_EXCLUSION image tag mutability mode in ECR repositories, allowing users to specify exclusion filters for tags that should remain mutable while enforcing immutability for all others. Changes: - Add image_tag_mutability_exclusion_filter configuration block - Support IMMUTABLE_WITH_EXCLUSION as a valid image_tag_mutability value - Add validation for exclusion filters (max 5 filters, max 128 chars, max 2 wildcards) - Add cross-field validation to ensure filters are only used with appropriate mutability modes - Add comprehensive acceptance tests including cross-field validation test - Update documentation with examples and constraints Closes hashicorp#43569
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
|
✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible. |
|
fyi cli shows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccECRRepository_' PKG=ecr ACCTEST_PARALELLISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.5 test ./internal/service/ecr/... -v -count 1 -parallel 20 -run=TestAccECRRepository_ -timeout 360m -vet=off
2025/08/06 11:07:53 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/06 11:07:53 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN TestAccECRRepository_basic
=== PAUSE TestAccECRRepository_basic
=== RUN TestAccECRRepository_disappears
=== PAUSE TestAccECRRepository_disappears
=== RUN TestAccECRRepository_tags
=== PAUSE TestAccECRRepository_tags
=== RUN TestAccECRRepository_immutability
=== PAUSE TestAccECRRepository_immutability
=== RUN TestAccECRRepository_immutabilityWithExclusion
=== PAUSE TestAccECRRepository_immutabilityWithExclusion
=== RUN TestAccECRRepository_mutabilityWithExclusion
=== PAUSE TestAccECRRepository_mutabilityWithExclusion
=== RUN TestAccECRRepository_immutabilityWithExclusion_validation
=== PAUSE TestAccECRRepository_immutabilityWithExclusion_validation
=== RUN TestAccECRRepository_immutabilityWithExclusion_crossValidation
=== PAUSE TestAccECRRepository_immutabilityWithExclusion_crossValidation
=== RUN TestAccECRRepository_Image_scanning
=== PAUSE TestAccECRRepository_Image_scanning
=== RUN TestAccECRRepository_Encryption_kms
=== PAUSE TestAccECRRepository_Encryption_kms
=== RUN TestAccECRRepository_Encryption_aes256
=== PAUSE TestAccECRRepository_Encryption_aes256
=== CONT TestAccECRRepository_basic
=== CONT TestAccECRRepository_immutabilityWithExclusion_validation
=== CONT TestAccECRRepository_Encryption_kms
=== CONT TestAccECRRepository_tags
=== CONT TestAccECRRepository_disappears
=== CONT TestAccECRRepository_immutability
=== CONT TestAccECRRepository_Encryption_aes256
=== CONT TestAccECRRepository_Image_scanning
=== CONT TestAccECRRepository_immutabilityWithExclusion_crossValidation
=== CONT TestAccECRRepository_mutabilityWithExclusion
=== CONT TestAccECRRepository_immutabilityWithExclusion
--- PASS: TestAccECRRepository_immutabilityWithExclusion_crossValidation (3.47s)
--- PASS: TestAccECRRepository_immutabilityWithExclusion_validation (5.20s)
--- PASS: TestAccECRRepository_disappears (16.07s)
--- PASS: TestAccECRRepository_immutability (18.70s)
--- PASS: TestAccECRRepository_basic (18.76s)
--- PASS: TestAccECRRepository_immutabilityWithExclusion (26.67s)
--- PASS: TestAccECRRepository_mutabilityWithExclusion (27.25s)
--- PASS: TestAccECRRepository_Encryption_aes256 (32.96s)
--- PASS: TestAccECRRepository_tags (34.67s)
--- PASS: TestAccECRRepository_Image_scanning (41.34s)
--- PASS: TestAccECRRepository_Encryption_kms (47.64s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ecr 53.187sThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
|
@yoshizawa56 Thanks for the contribution 🎉 👏. |
|
Warning This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
|
This functionality has been released in v6.8.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
no
Description
This PR adds support for the
IMMUTABLE_WITH_EXCLUSIONimage tag mutability mode for ECR repositories, allowing users to specify exclusion filters for tags that should remain mutable while enforcing immutability for all others.Changes:
image_tag_mutability_exclusion_filterconfiguration blockIMMUTABLE_WITH_EXCLUSIONas a validimage_tag_mutabilityvalueRelations
Closes #43569
References
Output from Acceptance Testing