nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #119

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

The correct answer is B. It will happen automatically. When you manually delete infrastructure outside of Terraform, the next time you run 'terraform plan' or 'terraform apply', Terraform automatically performs a refresh against the real infrastructure before computing the diff. It discovers that the resource no longer exists and upd

Submitted by kev92· Apr 18, 2026Manage Terraform State

Question

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

Options

  • ARun terraform refresh
  • BIt will happen automatically
  • CManually update the state fire
  • DRun terraform import

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    88% (22)
  • C
    8% (2)

Explanation

When you manually delete infrastructure outside of Terraform, the next time you run 'terraform plan' or 'terraform apply', Terraform automatically performs a refresh against the real infrastructure before computing the diff. It discovers that the resource no longer exists and updates its internal understanding accordingly, showing the resource as needing to be re-created (or flagging the drift). You do not need to manually edit the state file or run a separate command - the detection and state reconciliation happen automatically during the normal plan/apply cycle.

Topics

#Terraform State#Manual Changes#terraform refresh#Terraform Lifecycle

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice