-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Order of actions is incorrect when applying a config that removes a resource that is referenced by another resource #26173
Comments
We are experiencing same kind of issue with terraform-provider-nsxt. Still happens with terraform 0.13. |
Hi @shinmog, Sorry about the confusion here, but this is the correct default order of operations for Terraform.
In this case you can see that you would have the same problem, where the first operation would fail because the
From here, you can see that with only the removal of the The major caveat here is that the removal-only case will only work in 0.13. Prior to 0.13 you will have to manually fixup the resources or use We use GitHub issues for tracking bugs and enhancements, rather than for questions. While we can sometimes help with certain simple problems here, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by our few core maintainers. Based on the information you've provided, it looks like this doesn't represent a specific bug or feature request, even though I understand that Terraform isn't doing what you expect it to, and so I'm going to close it. Please do feel free to ask your question in the community forum. Thanks! |
Hello @jbardin, I don't think |
@annakhm, The order listed above covers this, just skip the "create" step which isn't present, and you have
|
Thank you @jbardin! Indeed that works, however I found that |
Ah yes, we have an issue covering that here (#25473) for anyone interested. |
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. |
Terraform Version
Terraform Configuration Files
Initial deployment config:
Update config (and thus this GitHub issue):
Debug Output
https://gist.github.com/shinmog/a09c3f2c23da7ec2d3761b0156d9f2ee
Crash Output
N/A
Expected Behavior
Terraform needs to:
Actual Behavior
Terraform wants to delete address object C first, which it can't since group X is referencing it.
Steps to Reproduce
terraform init
(with first config)terraform apply
(with first config)terraform apply
(with second config)Additional Context
I've also tried changing the resource references to
depends_on
to see if Terraform would behave differently, but the same thing happens.References
The text was updated successfully, but these errors were encountered: