A single resource was destroyed during the terraform apply process

Hi there,

Recently, we encountered an issue regarding the destruction of a specific resource.

The version of Terraform is 0.12.29. We are using Terraform on GCP. During a terraform apply command one of the disks that are created and attached to an instance got destroyed.

Let me give some background information: We are using Terraform behind an internal web service, which receives input from users and populates auto.tfvars files and creates the infrastructure using the values from those auto.tfvars files. I’m pretty sure that, there is something wrong with the web service part but I want to understand in which cases only a specific resource can be destroyed while others stay as they are. So we can improve the web service part to prevent this kind of destruction.

One idea is the resource might be marked as tainted. For some reason, Terraform might have done this but in this case, the resource should have been recreated as far as I know. But it didn’t get created.

For what other reasons a “terraform apply” operation can delete a resource but keep the others intact in the same infrastructure? Any ideas?

Thanks in advance,



A resource can be recreated if its description has changed (drift) and is not modifiable because the provider API says so or that the Terraform provider implementation is limited.

Example with AWS:

Do you know what diff occured and led to this destruction?

Thank you, @ohmer. As far as I can see, there is no change in the files we set the variables. If I found something suspicious I will add it here.