HashiCorp Certified: Terraform Associate — Question 184
A senior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?
Answer options
- A. Build a completely brand new set of infrastructure
- B. Tear down the entire workspace infrastructure and rebuild it
- C. Rebuild only the instances that were deleted
- D. Stop and generate an error message about the missing instances
Correct answer: C
Explanation
The correct answer is C because Terraform is designed to manage the state of your infrastructure and will only recreate resources that are missing or have been deleted. Options A and B are incorrect as they imply a complete rebuild of all resources, which is not how Terraform functions. Option D is also wrong because Terraform will attempt to reconcile the state and restore the missing instances rather than just halting with an error.