Closed sophiecosgrove closed 1 week ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @sophiecosgrove π Thank you for taking the time to raise this! This seems like an appropriate time to use replace_triggered_by
in order to force replacement of the appropriate resource(s). Since the API allows for the image_recipe_arn
to be updated, the provider should respect that behavior (hence the change in the PR that you linked to), but replace_triggered_by
should help in your case. Can you give that approach a try and see if that resolves your issue?
Hey @sophiecosgrove π Thank you for taking the time to raise this! This seems like an appropriate time to use
replace_triggered_by
in order to force replacement of the appropriate resource(s). Since the API allows for theimage_recipe_arn
to be updated, the provider should respect that behavior (hence the change in the PR that you linked to), butreplace_triggered_by
should help in your case. Can you give that approach a try and see if that resolves your issue?
I had the same issue, this worked for me, thank you!
Hi, that has worked for me as well. Thanks
[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. 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.
Making sure the pipeline (the thing that depends on the recipe) is destroyed before deleting (due to recreation) the recipe works for me;
resource "aws_imagebuilder_image_pipeline" "main" {
...
lifecycle {
replace_triggered_by = [
aws_imagebuilder_image_recipe.main
]
}
}
resource "aws_imagebuilder_image_recipe" "main" {
...
parent_image = "ami-xxx" # <-- forces replacement (with same version)
}
Terraform Core Version
1.9.8
AWS Provider Version
5.74.0
Affected Resource(s)
aws_imagebuilder_image_recipe, aws_imagebuilder_image_pipeline
Expected Behavior
Image recipe is expected to be deleted and recreated to facilitate component change.
Actual Behavior
Image recipe can't be deleted because of an update in 5.74.0 which allows the image pipeline to be updated in place: https://github.com/hashicorp/terraform-provider-aws/pull/39117 producing a dependency error. Previously the image pipeline would have been deleted and recreated, followed by the same for recipe and component, as per the order here: https://docs.aws.amazon.com/imagebuilder/latest/userguide/delete-resources.html. However now the pipeline is being updated in place it means that it's dependent on the recipe so the recipe can't be recreated.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
N/A
Steps to Reproduce
Create an image pipeline with attached recipe and component. Change component to cause a recreation of the recipe.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None