nerdexam
HashiCorpHashiCorp

TERRAFORM-ASSOCIATE-004 · Question #15

TERRAFORM-ASSOCIATE-004 Question #15: Real Exam Question with Answer & Explanation

The correct answer is C: The Terraform state file only contains the one new VM. Execute terraform destroy.. Terraform's state file only tracks resources that were provisioned by that specific Terraform configuration - it has no knowledge of the 15 pre-existing VMs that were created outside of it. Therefore, Option A is incorrect; the state file contains only the 1 newly created VM. Run

Submitted by suresh_in· Apr 18, 2026Manage Terraform State

Question

You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?

Options

  • AThe Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and
  • BDelete the Terraform state file and execute terraform apply.
  • CThe Terraform state file only contains the one new VM. Execute terraform destroy.
  • DDelete the VM using the cloud provider console and terraform apply to apply the changes to the

Explanation

Terraform's state file only tracks resources that were provisioned by that specific Terraform configuration - it has no knowledge of the 15 pre-existing VMs that were created outside of it. Therefore, Option A is incorrect; the state file contains only the 1 newly created VM. Running terraform destroy (C) will safely remove only the resources recorded in the current state file, leaving the other 15 VMs completely untouched. Option B (deleting the state file) would orphan the resource. Option D bypasses IaC practices.

Topics

#Terraform state#terraform destroy#Resource management#Terraform CLI

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 PracticeBrowse All TERRAFORM-ASSOCIATE-004 Questions