-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Terraform destroyed the resources instead of updating them #19974
Comments
What did the "terraform plan" output say? That it was going to "update in place" and then went on to "destroy and recreate" the resources? Curious because I don't see any output for terraform plan in the logs you pasted above. In my experience, it does call out specifically in case there is something it needs to destroy and recreate. Also denotes the change with a "-/+" symbol. |
We do not have a |
It depends on the resource you are trying to modify/update. Some resources don't allow "updates in place". Ex - In AWS, you can update an instance's security group in place, but if you try to update the AMI for an instance, it will destroy and recreate the instance. |
Thanks @abiydv for your reply, |
I think the easiest way to check would be to run terraform plan. Other than that, I guess Azure's docs might help w.r.t what parameters can be changed once the resource has been created. The parameters which can't be changed after creation would lead terraform to destroy & create. |
Hi @agrcrobles, I'm sorry to hear you've experienced this. As @abiydv indicated, you would need to run You can find the provider documentation here. You will find that there are several resources (in all providers) that require recreation to apply a change instead of update. We suggest never running Please note that we use GitHub issues for tracking bugs and enhancements rather than for questions. While we may be able to help with certain simple problems here it's generally better to use one of the community forums where there are far more people ready to help, whereas the GitHub issues here are generally monitored only by our few core maintainers. |
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. |
Hi there,
TLDR; Terraform destroyed all the resources and tried to recreate them, instead it should have update them.
Terraform Version
Expected Behavior
Terraform should have updated the resources
Actual Behavior
Terraform destroyed the resources and attemped to recreate them.
Steps to Reproduce
Additional Context
Our
backend.tf
is configured this way and thetfstate
file is saved in our Azure storage as it is suggestedDebug Output ( Full log )
References
None that I am aware of.
Please let me know if there is need for more information to follow up this one
Thanks in advance.
The text was updated successfully, but these errors were encountered: