Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 270

If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

    Correct Answer: A

    If you have manually destroyed infrastructure, the best practice is to manually update the state file. This allows Terraform to accurately reflect the current state of your infrastructure. Removing a resource definition or running commands like 'terraform apply -refresh-only' or 'terraform import' are not appropriate in this context because they either attempt to reconcile desired state with reality or import existing resources, but do not directly address the discrepancy caused by manual deletion.

Discussion
DANDA9989Option: B

B. Remove the resource definition from your file and run terraform apply -refresh-only

Pete987Option: B

B. Remove the resource definition from your file and run terraform apply -refresh-only C