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
[Bug]: aws_batch_compute_environment: launch_template version known after apply does not ForceNew #37440
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
A quick update. Turns out the By setting the
Trying to find a workaround now to support our various use cases--both with and without launch templates, but figured it was worth posting as it provides additional evidence for the necessity of this fix. |
Terraform Core Version
1.8.2
AWS Provider Version
5.49.0
Affected Resource(s)
aws_batch_compute_environment
aws_launch_template
Expected Behavior
When updating the launch template associated with a compute environment and pointing the compute environment to the
default_version
, and also having the launch_template set to update_default_version, the compute environment should be recreated and no error should occur.Actual Behavior
The compute environment is NOT recreated, and terraform throws "Provider produced inconsistent final plan"
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
user_data
so that thelaunch_template
updates and wants to create a new versionThe first plan shows:
As you can see above, there is no "recreation" of resource, but it is an update of a field that is immutable.
After the error, if you run another plan, at this point the launch template has been updated so the value is known:
As you can see above, there is a known value this time (3), and it triggers a replacement correctly, and there is no error.
Solution
To resolve this issue, we can use a simple
replace_triggered_by
, which produces the following plan:However, I feel that this should be something handled by the provider, versus us having to implement our own solution.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: