Skip to content

Conversation

@vivian-az
Copy link

… deletion

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Description

This change adds support for optional deletion_settings parameter for Image Builder images. For deleting AMI images, it removes both AMIs and associated snapshots, while for container images, it removes the container images from the registry. This eliminates the need for manual cleanup scripts and ensures proper resource lifecycle management.

Example configuration

resource "aws_imagebuilder_image" "example" {
  name                           = "example-image"
  image_recipe_arn              = aws_imagebuilder_image_recipe.example.arn
  infrastructure_configuration_arn = aws_imagebuilder_infrastructure_configuration.example.arn

  deletion_settings {
    execution_role = aws_iam_role.imagebuilder_deletion_role.arn
  }
}

Relations

Relates Issues#110

References

Output from Acceptance Testing

TF_ACC=1 go test ./internal/service/imagebuilder/... -v -count 1 -run='TestAccImageBuilderImage_(basic|deletionSettings)'
2025/12/07 22:44:45 Creating Terraform AWS Provider (SDKv2-style)...
2025/12/07 22:44:45 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccImageBuilderImage_basic
=== PAUSE TestAccImageBuilderImage_basic
=== RUN   TestAccImageBuilderImage_deletionSettings
=== PAUSE TestAccImageBuilderImage_deletionSettings
=== CONT  TestAccImageBuilderImage_basic
=== CONT  TestAccImageBuilderImage_deletionSettings
--- PASS: TestAccImageBuilderImage_basic (873.66s)
--- PASS: TestAccImageBuilderImage_deletionSettings (1074.65s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder	1074.803s

...

@vivian-az vivian-az requested a review from a team as a code owner December 8, 2025 16:28
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Community Guidelines

This 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

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. size/L Managed by automation to categorize the size of a PR. labels Dec 8, 2025
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/imagebuilder Issues and PRs that pertain to the imagebuilder service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants