-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Incorrect "Provider produced inconsistent final plan" error when changing count or for_each of resources with create_before_destroy #25631
Comments
Is there a workaround for this? |
For now you should be able to target the resource that needs to be removed first, then complete the rest of the apply afterwards. In this case it would be |
@jbardin Thank you for handling the other bugs (#26226, #26252, #26166, #26180) so quickly. Unfortunately, this one is still a significant problem for me. The resource that needs to be destroyed is an AWS security group, and to destroy that, it needs to have anything using it destroyed first, which includes create-before-destroy resources. Targeting the resource that needs to be removed would defeat the whole create-before-destroy idea. Is there perhaps a way to convert this to the now fixed #26252 ? UPDATE: I think I've got the workaround. Still looking forward to this getting fixed. |
@jbardin Does it treat an update and a destroy situation? In my case, I want to update a NIC field and destroy the PIP resource.
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When referencing multiple instances of a resource with
create_before_destroy
, reducing the number of instances will not be correctly updated on the first apply.For example:
This will create 2
null_resource.a
instances, and record their keys and ids in the singlenull_resource.b
instance.Now if the "second" map value is removed, the resulting plan will look like
This however will fail during apply with:
This is because the evaluation for the
resource.a
during apply will also contain nodes that are scheduled for destruction, which does not happen during the plan phase. This was fixed for 0.13, but needed to be reverted when it was discovered that provider and destroy provisioner evaluation was not equipped to handle this, and we must continue to include the deposed instances in the resource evaluation.The text was updated successfully, but these errors were encountered: