-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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]: Provider produced inconsistent final plan - changed the planned action from Update to DeleteThenCreate #33690
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I have just started running into something similar to this:
When modifying an existing state, I get errors similar to the above. I can destroy the resources with no problem I can create a fresh set of resources Specifically this seems to be affecting aws_batch_compute_environment
|
I see the same issue.
|
We were running into the same issue with the In some cases for our We worked around this by always forcing a replacement when the
There are likely more elegant ways to define |
I am unable to reproduce the error. Here is one example (of many) that I tried:
The original issue for aws_instance may be resolved, I recommend closing unless a more detailed failure scenario is provided. |
* correct config for launch version setting removing Computed for consistency * hashicorp#33690
The PR #38628 fixes the issue noted by various comments regarding aws_batch_compute_environment. |
Terraform Core Version
v1.5.5
AWS Provider Version
v5.16.2
Affected Resource(s)
aws_instance
Expected Behavior
Successful apply
Actual Behavior
Error. Retrying on the same state succeeds.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Plan
Steps to Reproduce
resource "aws_instance"
contains the attributeuser_data_replace_on_change = true
terraform apply
Debug Output
None
Panic Output
None
Important Factoids
Whenever we are going to deploy a new version, the
aws_instance
resources are marked for update in the plan (unless there are changes in other attributes like ami. In that case, it forces a replacement and works). When applying, it crashes with:If we re-apply after the failure, the
aws_instance
resource is marked for replacement and the deployment just works fine.Workaround
If we deploy a new version but this time forcing the replacement with
-replace
or-taint
, the instances are marked for replace on the first attempt and the deployment just works fine.The most accurate description of the cause can be found here: #29012 (comment)
References
Similar/related issues:
#29012
#23315
hashicorp/terraform-provider-azurerm#21402
The issue #29012 is the most closely related to this current issue. Unfortunately, it's closed although the issue is still happening in the newest versions of the provider and wrecking our deployments every day.
The text was updated successfully, but these errors were encountered: