HashiCorp
TERRAFORM-ASSOCIATE-003 · Question #41
TERRAFORM-ASSOCIATE-003 Question #41: Real Exam Question with Answer & Explanation
The correct answer is D. Terraform will destroy the virtual machine. This is what will happen if you run terraform apply in the working directory again, after removing the resource definition from your Terraform configuration file. Terraform will detect that there is a resource in the state file that is not present in the configuration file, and w
Question
You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file. What will happen you run terraform apply in the working directory again?
Options
- ATerraform will remove the virtual machine from the state file, but the resource will still exist
- BNothing
- CTerraform will error
- DTerraform will destroy the virtual machine
Explanation
This is what will happen if you run terraform apply in the working directory again, after removing the resource definition from your Terraform configuration file. Terraform will detect that there is a resource in the state file that is not present in the configuration file, and will assume that you want
Community Discussion
No community discussion yet for this question.