QuestionQ3

VerifiedTerraform state management

You have a Terraform configuration that defines one virtual machine, with no references to that VM. You ran terraform apply to create the resource and then removed its resource definition from the Terraform configuration file.

What occurs when you run terraform apply again in the working directory?

Explanation

Terraform treats a managed resource that exists in state but no longer has a corresponding configuration block as a resource to destroy. Applying the resulting plan deletes the virtual machine.

Community Discussion

No comments yet. Be the first to start the discussion!