Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 270


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

Show Answer
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

2 comments
Sign in to comment
Pete987Option: B
Aug 23, 2023

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

DANDA9989Option: B
Sep 15, 2023

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