-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Change for recipe ARN should not force new pipeline #39117
Change for recipe ARN should not force new pipeline #39117
Conversation
Community NoteVoting for Prioritization
For Submitters
|
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.
Welcome @dex4er 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
FYI, as I see, awscc provider behaves correctly: # module.base_ami.awscc_imagebuilder_image_pipeline.this will be updated in-place
~ resource "awscc_imagebuilder_image_pipeline" "this" {
id = "arn:aws:imagebuilder:eu-central-1:123456789012:image-pipeline/ubuntu-noble-24-04-amd64"
~ image_recipe_arn = "arn:aws:imagebuilder:eu-central-1:123456789012:image-recipe/ubuntu-noble-24-04-amd64/1.0.20240827" -> (known after apply)
~ image_scanning_configuration = {
}
name = "ubuntu-noble-24_04-amd64"
tags = {
"Arch" = "amd64"
"Name" = "ubuntu-noble-24_04-amd64"
}
} |
…`, `component.parameter.value`, `target_repository.repository_name`, and `target_repository.service` to ForceNew.
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=TestAccImageBuilderImagePipeline_' PKG=imagebuilder ACCTEST_PARALLELISM=4
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/imagebuilder/... -v -count 1 -parallel 4 -run=TestAccImageBuilderImagePipeline_ -timeout 360m
2024/10/29 11:33:38 Initializing Terraform AWS Provider...
=== RUN TestAccImageBuilderImagePipeline_basic
=== PAUSE TestAccImageBuilderImagePipeline_basic
=== RUN TestAccImageBuilderImagePipeline_disappears
=== PAUSE TestAccImageBuilderImagePipeline_disappears
=== RUN TestAccImageBuilderImagePipeline_description
=== PAUSE TestAccImageBuilderImagePipeline_description
=== RUN TestAccImageBuilderImagePipeline_distributionARN
=== PAUSE TestAccImageBuilderImagePipeline_distributionARN
=== RUN TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
=== PAUSE TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
=== RUN TestAccImageBuilderImagePipeline_imageRecipeARN
=== PAUSE TestAccImageBuilderImagePipeline_imageRecipeARN
=== RUN TestAccImageBuilderImagePipeline_containerRecipeARN
=== PAUSE TestAccImageBuilderImagePipeline_containerRecipeARN
=== RUN TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
=== PAUSE TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
=== RUN TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
=== PAUSE TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
=== RUN TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
=== PAUSE TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
=== RUN TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
=== PAUSE TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
=== RUN TestAccImageBuilderImagePipeline_infrastructureARN
=== PAUSE TestAccImageBuilderImagePipeline_infrastructureARN
=== RUN TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
=== PAUSE TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
=== RUN TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
=== PAUSE TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
=== RUN TestAccImageBuilderImagePipeline_Schedule_timezone
=== PAUSE TestAccImageBuilderImagePipeline_Schedule_timezone
=== RUN TestAccImageBuilderImagePipeline_status
=== PAUSE TestAccImageBuilderImagePipeline_status
=== RUN TestAccImageBuilderImagePipeline_tags
=== PAUSE TestAccImageBuilderImagePipeline_tags
=== RUN TestAccImageBuilderImagePipeline_workflow
=== PAUSE TestAccImageBuilderImagePipeline_workflow
=== RUN TestAccImageBuilderImagePipeline_workflowParameter
=== PAUSE TestAccImageBuilderImagePipeline_workflowParameter
=== CONT TestAccImageBuilderImagePipeline_basic
=== CONT TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes
=== CONT TestAccImageBuilderImagePipeline_status
=== CONT TestAccImageBuilderImagePipeline_workflow
--- PASS: TestAccImageBuilderImagePipeline_basic (26.71s)
=== CONT TestAccImageBuilderImagePipeline_Schedule_scheduleExpression
--- PASS: TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes (36.68s)
=== CONT TestAccImageBuilderImagePipeline_Schedule_timezone
--- PASS: TestAccImageBuilderImagePipeline_status (37.44s)
=== CONT TestAccImageBuilderImagePipeline_workflowParameter
--- PASS: TestAccImageBuilderImagePipeline_workflow (39.39s)
=== CONT TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition
--- PASS: TestAccImageBuilderImagePipeline_Schedule_scheduleExpression (35.92s)
=== CONT TestAccImageBuilderImagePipeline_tags
--- PASS: TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition (35.42s)
=== CONT TestAccImageBuilderImagePipeline_infrastructureARN
=== CONT TestAccImageBuilderImagePipeline_imageRecipeARN
--- PASS: TestAccImageBuilderImagePipeline_Schedule_timezone (38.14s)
--- PASS: TestAccImageBuilderImagePipeline_workflowParameter (44.08s)
=== CONT TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled
--- PASS: TestAccImageBuilderImagePipeline_infrastructureARN (40.03s)
=== CONT TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
--- PASS: TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled (34.20s)
=== CONT TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
=== NAME TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced
acctest.go:1679: skipping test for aws/us-west-2: Error running apply: exit status 1
Error: creating Image Builder Image Pipeline: operation error imagebuilder: CreateImagePipeline, https response error StatusCode: 400, RequestID: 937924bf-a89c-4245-a971-b35880e176a3, api error ResourceDependencyException: Resource dependency error: Amazon Inspector is not enabled for 'ecr' resources in account '187416307283'.
with aws_imagebuilder_image_pipeline.test,
on terraform_plugin_test.tf line 105, in resource "aws_imagebuilder_image_pipeline" "test":
105: resource "aws_imagebuilder_image_pipeline" "test" {
--- PASS: TestAccImageBuilderImagePipeline_tags (68.54s)
=== CONT TestAccImageBuilderImagePipeline_containerRecipeARN
--- SKIP: TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabledAdvanced (16.69s)
=== CONT TestAccImageBuilderImagePipeline_distributionARN
--- PASS: TestAccImageBuilderImagePipeline_imageRecipeARN (62.12s)
=== CONT TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled
=== NAME TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled
acctest.go:1679: skipping test for aws/us-west-2: Error running apply: exit status 1
Error: updating Image Builder Image Pipeline (arn:aws:imagebuilder:us-west-2:187416307283:image-pipeline/tf-acc-test-6675496076042225490): operation error imagebuilder: UpdateImagePipeline, https response error StatusCode: 400, RequestID: bf226de9-7307-4de2-b2e6-9d95c60bd006, api error ResourceDependencyException: Resource dependency error: Amazon Inspector is not enabled for 'ec2' resources in account '187416307283'.
with aws_imagebuilder_image_pipeline.test,
on terraform_plugin_test.tf line 105, in resource "aws_imagebuilder_image_pipeline" "test":
105: resource "aws_imagebuilder_image_pipeline" "test" {
--- SKIP: TestAccImageBuilderImagePipeline_ImageScanning_imageScanningEnabled (29.60s)
=== CONT TestAccImageBuilderImagePipeline_description
--- PASS: TestAccImageBuilderImagePipeline_distributionARN (35.30s)
=== CONT TestAccImageBuilderImagePipeline_disappears
--- PASS: TestAccImageBuilderImagePipeline_containerRecipeARN (37.48s)
--- PASS: TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled (37.60s)
--- PASS: TestAccImageBuilderImagePipeline_description (36.70s)
--- PASS: TestAccImageBuilderImagePipeline_disappears (23.87s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder 195.814s
% make testacc TESTARGS='-run=TestAccImageBuilderContainerRecipe_' PKG=imagebuilder ACCTEST_PARALLELISM=4
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/imagebuilder/... -v -count 1 -parallel 4 -run=TestAccImageBuilderContainerRecipe_ -timeout 360m
2024/10/29 11:41:55 Initializing Terraform AWS Provider...
=== RUN TestAccImageBuilderContainerRecipe_basic
=== PAUSE TestAccImageBuilderContainerRecipe_basic
=== RUN TestAccImageBuilderContainerRecipe_disappears
=== PAUSE TestAccImageBuilderContainerRecipe_disappears
=== RUN TestAccImageBuilderContainerRecipe_component
=== PAUSE TestAccImageBuilderContainerRecipe_component
=== RUN TestAccImageBuilderContainerRecipe_componentParameter
=== PAUSE TestAccImageBuilderContainerRecipe_componentParameter
=== RUN TestAccImageBuilderContainerRecipe_description
=== PAUSE TestAccImageBuilderContainerRecipe_description
=== RUN TestAccImageBuilderContainerRecipe_dockerfileTemplateURI
=== PAUSE TestAccImageBuilderContainerRecipe_dockerfileTemplateURI
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_deviceName
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_deviceName
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_deleteOnTermination
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_deleteOnTermination
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_encrypted
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_encrypted
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_iops
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_iops
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_kmsKeyID
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_kmsKeyID
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_snapshotID
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_snapshotID
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_throughput
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_throughput
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeSize
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeSize
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeType
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeType
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_noDevice
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_noDevice
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_virtualName
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_virtualName
=== RUN TestAccImageBuilderContainerRecipe_InstanceConfiguration_Image
=== PAUSE TestAccImageBuilderContainerRecipe_InstanceConfiguration_Image
=== RUN TestAccImageBuilderContainerRecipe_kmsKeyID
=== PAUSE TestAccImageBuilderContainerRecipe_kmsKeyID
=== RUN TestAccImageBuilderContainerRecipe_tags
=== PAUSE TestAccImageBuilderContainerRecipe_tags
=== RUN TestAccImageBuilderContainerRecipe_workingDirectory
=== PAUSE TestAccImageBuilderContainerRecipe_workingDirectory
=== RUN TestAccImageBuilderContainerRecipe_platformOverride
=== PAUSE TestAccImageBuilderContainerRecipe_platformOverride
=== CONT TestAccImageBuilderContainerRecipe_basic
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_snapshotID
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_deviceName
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_Image
--- PASS: TestAccImageBuilderContainerRecipe_basic (17.81s)
=== CONT TestAccImageBuilderContainerRecipe_platformOverride
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_deviceName (17.90s)
=== CONT TestAccImageBuilderContainerRecipe_workingDirectory
--- PASS: TestAccImageBuilderContainerRecipe_platformOverride (16.39s)
=== CONT TestAccImageBuilderContainerRecipe_tags
--- PASS: TestAccImageBuilderContainerRecipe_workingDirectory (17.37s)
=== CONT TestAccImageBuilderContainerRecipe_kmsKeyID
--- PASS: TestAccImageBuilderContainerRecipe_kmsKeyID (18.03s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeSize
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeSize (16.96s)
=== CONT TestAccImageBuilderContainerRecipe_componentParameter
--- PASS: TestAccImageBuilderContainerRecipe_tags (36.44s)
=== CONT TestAccImageBuilderContainerRecipe_dockerfileTemplateURI
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_Image (72.61s)
=== CONT TestAccImageBuilderContainerRecipe_description
--- PASS: TestAccImageBuilderContainerRecipe_componentParameter (18.21s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_virtualName
--- PASS: TestAccImageBuilderContainerRecipe_description (17.29s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_throughput
--- PASS: TestAccImageBuilderContainerRecipe_dockerfileTemplateURI (20.56s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_noDevice
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_virtualName (16.39s)
=== CONT TestAccImageBuilderContainerRecipe_component
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping_noDevice (17.03s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_iops
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_throughput (18.82s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_kmsKeyID
--- PASS: TestAccImageBuilderContainerRecipe_component (17.89s)
=== CONT TestAccImageBuilderContainerRecipe_disappears
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_iops (17.05s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_encrypted
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_kmsKeyID (19.12s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_deleteOnTermination
--- PASS: TestAccImageBuilderContainerRecipe_disappears (14.68s)
=== CONT TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeType
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_snapshotID (137.87s)
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_encrypted (17.35s)
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_deleteOnTermination (17.20s)
--- PASS: TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMappingEBS_volumeType (17.71s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/imagebuilder 160.317s
@dex4er Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.74.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! |
Description
Currently provider forces to recreate a pipeline if version of recipe changes:
It is possible to change recipe ARN in the builder pipeline without recreating it:
Example:
Result:
Relations
Closes #39803.
References
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/imagebuilder_image_pipeline#image_recipe_arn
https://docs.aws.amazon.com/imagebuilder/latest/APIReference/API_UpdateImagePipeline.html
Output from Acceptance Testing
Failures are not related to the change.