Skip to content

Conversation

stefanfreitag
Copy link
Contributor

@stefanfreitag stefanfreitag commented Oct 20, 2025

Rollback Plan

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

Changes to Security Controls

None

Description

Allow users to specify AMI tags as part of EC2 ImageBuilder Image Recipes.

Relations

Closes #44654

References

Output from Acceptance Testing

Resource (one test failing, but unrelated to my changes. It was failing before).

make testacc TESTS=TestAccImageBuilderImageRecipe_ PKG=imagebuilder
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_imagebuilder_image_recipe-ami-tags-support 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/imagebuilder/... -v -count 1 -parallel 20 -run='TestAccImageBuilderImageRecipe_'  -timeout 360m -vet=off
2025/10/20 20:03:47 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/20 20:03:47 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccImageBuilderImageRecipe_Identity_Basic
=== PAUSE TestAccImageBuilderImageRecipe_Identity_Basic
=== RUN   TestAccImageBuilderImageRecipe_Identity_RegionOverride
=== PAUSE TestAccImageBuilderImageRecipe_Identity_RegionOverride
=== RUN   TestAccImageBuilderImageRecipe_Identity_ExistingResource
=== PAUSE TestAccImageBuilderImageRecipe_Identity_ExistingResource
=== RUN   TestAccImageBuilderImageRecipe_Identity_ExistingResource_NoRefresh_NoChange
=== PAUSE TestAccImageBuilderImageRecipe_Identity_ExistingResource_NoRefresh_NoChange
=== RUN   TestAccImageBuilderImageRecipe_basic
=== PAUSE TestAccImageBuilderImageRecipe_basic
=== RUN   TestAccImageBuilderImageRecipe_disappears
=== PAUSE TestAccImageBuilderImageRecipe_disappears
=== RUN   TestAccImageBuilderImageRecipe_amiTags
=== PAUSE TestAccImageBuilderImageRecipe_amiTags
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMapping_deviceName
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMapping_deviceName
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_deleteOnTermination
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_deleteOnTermination
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_encrypted
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_encrypted
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_iops
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_iops
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_kmsKeyID
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_kmsKeyID
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_snapshotID
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_snapshotID
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_throughput
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_throughput
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeSize
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeSize
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP2
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP2
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP3
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP3
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMapping_noDevice
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMapping_noDevice
=== RUN   TestAccImageBuilderImageRecipe_BlockDeviceMapping_virtualName
=== PAUSE TestAccImageBuilderImageRecipe_BlockDeviceMapping_virtualName
=== RUN   TestAccImageBuilderImageRecipe_component
=== PAUSE TestAccImageBuilderImageRecipe_component
=== RUN   TestAccImageBuilderImageRecipe_componentParameter
=== PAUSE TestAccImageBuilderImageRecipe_componentParameter
=== RUN   TestAccImageBuilderImageRecipe_description
=== PAUSE TestAccImageBuilderImageRecipe_description
=== RUN   TestAccImageBuilderImageRecipe_tags
=== PAUSE TestAccImageBuilderImageRecipe_tags
=== RUN   TestAccImageBuilderImageRecipe_workingDirectory
=== PAUSE TestAccImageBuilderImageRecipe_workingDirectory
=== RUN   TestAccImageBuilderImageRecipe_pipelineUpdateDependency
=== PAUSE TestAccImageBuilderImageRecipe_pipelineUpdateDependency
=== RUN   TestAccImageBuilderImageRecipe_systemsManagerAgent
=== PAUSE TestAccImageBuilderImageRecipe_systemsManagerAgent
=== RUN   TestAccImageBuilderImageRecipe_updateDependency
=== PAUSE TestAccImageBuilderImageRecipe_updateDependency
=== RUN   TestAccImageBuilderImageRecipe_userDataBase64
=== PAUSE TestAccImageBuilderImageRecipe_userDataBase64
=== RUN   TestAccImageBuilderImageRecipe_windowsBaseImage
=== PAUSE TestAccImageBuilderImageRecipe_windowsBaseImage
=== CONT  TestAccImageBuilderImageRecipe_Identity_Basic
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP2
=== CONT  TestAccImageBuilderImageRecipe_windowsBaseImage
=== CONT  TestAccImageBuilderImageRecipe_userDataBase64
=== CONT  TestAccImageBuilderImageRecipe_updateDependency
=== CONT  TestAccImageBuilderImageRecipe_systemsManagerAgent
=== CONT  TestAccImageBuilderImageRecipe_pipelineUpdateDependency
=== CONT  TestAccImageBuilderImageRecipe_workingDirectory
=== CONT  TestAccImageBuilderImageRecipe_tags
=== CONT  TestAccImageBuilderImageRecipe_description
=== CONT  TestAccImageBuilderImageRecipe_componentParameter
=== CONT  TestAccImageBuilderImageRecipe_component
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMapping_virtualName
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMapping_noDevice
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP3
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeSize
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_throughput
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_snapshotID
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_kmsKeyID
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_iops
--- PASS: TestAccImageBuilderImageRecipe_componentParameter (79.38s)
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_encrypted
--- PASS: TestAccImageBuilderImageRecipe_workingDirectory (98.01s)
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_deleteOnTermination
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMapping_virtualName (98.10s)
=== CONT  TestAccImageBuilderImageRecipe_BlockDeviceMapping_deviceName
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP2 (103.19s)
=== CONT  TestAccImageBuilderImageRecipe_amiTags
--- PASS: TestAccImageBuilderImageRecipe_systemsManagerAgent (103.60s)
=== CONT  TestAccImageBuilderImageRecipe_disappears
=== NAME  TestAccImageBuilderImageRecipe_pipelineUpdateDependency
    image_recipe_test.go:648: Step 2/2 error: Error running apply: exit status 1
        
        Error: deleting Image Builder Image Recipe (arn:aws:imagebuilder:us-west-2:544871327925:image-recipe/tf-acc-test-656177334331747383/1.0.0): operation error imagebuilder: DeleteImageRecipe, https response error StatusCode: 400, RequestID: 5e2eb336-47bf-4f45-8a9d-6749c9c68f62, ResourceDependencyException: Resource dependency error: The resource ARN 'arn:aws:imagebuilder:us-west-2:544871327925:image-recipe/tf-acc-test-656177334331747383/1.0.0' has other resources depended on it.
        
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_kmsKeyID (113.73s)
=== CONT  TestAccImageBuilderImageRecipe_basic
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP3 (113.74s)
=== CONT  TestAccImageBuilderImageRecipe_Identity_ExistingResource_NoRefresh_NoChange
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMapping_noDevice (113.78s)
=== CONT  TestAccImageBuilderImageRecipe_Identity_ExistingResource
--- PASS: TestAccImageBuilderImageRecipe_component (113.78s)
=== CONT  TestAccImageBuilderImageRecipe_Identity_RegionOverride
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_iops (114.65s)
--- PASS: TestAccImageBuilderImageRecipe_windowsBaseImage (114.65s)
--- PASS: TestAccImageBuilderImageRecipe_userDataBase64 (114.84s)
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeSize (114.90s)
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_throughput (115.33s)
--- PASS: TestAccImageBuilderImageRecipe_description (115.33s)
--- FAIL: TestAccImageBuilderImageRecipe_pipelineUpdateDependency (124.31s)
--- PASS: TestAccImageBuilderImageRecipe_Identity_Basic (137.43s)
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_encrypted (66.89s)
--- PASS: TestAccImageBuilderImageRecipe_updateDependency (152.15s)
--- PASS: TestAccImageBuilderImageRecipe_disappears (49.71s)
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_snapshotID (155.22s)
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_deleteOnTermination (61.51s)
--- PASS: TestAccImageBuilderImageRecipe_BlockDeviceMapping_deviceName (61.53s)
--- PASS: TestAccImageBuilderImageRecipe_basic (48.54s)
--- PASS: TestAccImageBuilderImageRecipe_tags (165.14s)
--- PASS: TestAccImageBuilderImageRecipe_amiTags (98.41s)
--- PASS: TestAccImageBuilderImageRecipe_Identity_ExistingResource_NoRefresh_NoChange (88.08s)
--- PASS: TestAccImageBuilderImageRecipe_Identity_ExistingResource (88.18s)
--- PASS: TestAccImageBuilderImageRecipe_Identity_RegionOverride (100.56s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder       214.569s
FAIL
make: *** [GNUmakefile:681: testacc] Error 1

Data source

make testacc TESTS=TestAccImageBuilderImageRecipesDataSource_ PKG=imagebuilder
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_imagebuilder_image_recipe-ami-tags-support 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/imagebuilder/... -v -count 1 -parallel 20 -run='TestAccImageBuilderImageRecipesDataSource_'  -timeout 360m -vet=off
2025/10/20 20:10:01 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/20 20:10:01 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccImageBuilderImageRecipesDataSource_owner
=== PAUSE TestAccImageBuilderImageRecipesDataSource_owner
=== RUN   TestAccImageBuilderImageRecipesDataSource_filter
=== PAUSE TestAccImageBuilderImageRecipesDataSource_filter
=== RUN   TestAccImageBuilderImageRecipesDataSource_amiTags
=== PAUSE TestAccImageBuilderImageRecipesDataSource_amiTags
=== CONT  TestAccImageBuilderImageRecipesDataSource_owner
=== CONT  TestAccImageBuilderImageRecipesDataSource_amiTags
=== CONT  TestAccImageBuilderImageRecipesDataSource_filter
--- PASS: TestAccImageBuilderImageRecipesDataSource_owner (30.45s)
--- PASS: TestAccImageBuilderImageRecipesDataSource_amiTags (31.06s)
--- PASS: TestAccImageBuilderImageRecipesDataSource_filter (31.47s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder       31.682s

Copy link
Contributor

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 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. external-maintainer Contribution from a trusted external contributor. labels Oct 20, 2025
@stefanfreitag stefanfreitag marked this pull request as ready for review October 21, 2025 05:49
@stefanfreitag stefanfreitag requested a review from a team as a code owner October 21, 2025 05:49
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. external-maintainer Contribution from a trusted external contributor. needs-triage Waiting for first response or review from a maintainer. 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.

aws_imagebuilder_image_recipe should support AMI tags

1 participant