HashiCorp Certified: Terraform Associate — Question 3
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
Answer options
- A. Run terraform refresh
- B. It will happen automatically
- C. Manually update the state fire
- D. Run terraform import
Correct answer: A
Explanation
The correct answer is A, as running 'terraform refresh' updates the Terraform state to reflect the current state of the infrastructure. Option B is incorrect because changes do not automatically reflect in Terraform. Option C is not recommended due to the risk of state corruption, and option D is used for importing existing resources into Terraform, not for updating the state after manual destruction.