-
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
tf state file not updated if the terraform execution is interrupted #35386
Comments
Hi @divam20, thanks for filing this. The version of Terraform you are using (v0.12.29) is nearing 4 years old, it is possible that the state file management story has been improved since then. Are you able to test this with the latest release (v1.8.5) and confirm that this is still a concern? Thanks! |
The intended behavior for current versions of Terraform is that the first interrupt during an apply causes Terraform to write a state snapshot as soon as possible, tell providers that they should safely cancel any active operations as an as possible, and then aggressively write new state snapshots each time one of the active operations completes in a way that would update the state. A second interrupt caused Terraform to quit immediately, which is likely to cause state data loss. I don't remember when the above behaviors were each added. It is quite possible that Terraform v0.12 is too old to behave in this way. |
Since we have not heard back in a while I'm going to close the issue. If you have any updates regarding the issue, feel free to open a new issue with the requested information. If you have more questions, you can also use the community forum where there are more people ready to help. Thanks! |
Terraform Version
Terraform Configuration Files
Debug Output
NA
Expected Behavior
Since the terraform execution failed, the tfd plan should have shown the output that these resources need to be recreated or show only the resources which were not created in the previous execution of terraform.
Actual Behavior
Terraform was trying to create all the resources again and the state file was not updated
Steps to Reproduce
terraform init
terraform plan
terraform apply
Ctrl + C
terraform plan
Note: This is not happening everytime
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: