HashiCorp Terraform 004 Drift and State Refactors Guide

Study HashiCorp Terraform 004 Drift and State Refactors: key concepts, common traps, and exam decision cues.

Drift questions test whether you understand that infrastructure can change outside Terraform. State-refactor questions test whether you understand that Terraform management can change even if the infrastructure object itself does not need to be recreated.

Start with the difference

Situation Strongest reading
real infrastructure changed outside Terraform drift
you want Terraform to update its understanding without normal change intent refresh-only style workflow
configuration or addresses changed and state needs to follow moved or removed state refactor

Common traps

Trap Better rule
calling every unexpected plan output drift without checking configuration changes drift is specifically unexpected divergence from outside Terraform
assuming state refactor means resource recreation some state changes update Terraform’s understanding without recreating infrastructure
treating refresh-only like a normal apply of intended changes refresh-oriented operations focus on reconciling Terraform’s view

What strong answers usually do

  • define drift as out-of-band infrastructure change
  • recognize that Terraform can update state understanding separately from creating resources
  • separate intended configuration change from state reconciliation

Decision order that usually wins

Drift and refactor questions are about reconciling Terraform’s model with reality. If real infrastructure changed out of band, think drift. If Terraform needs to update its recorded understanding, think refresh-style behavior. If addresses or management structure changed without wanting blind recreation, think moved or removed state constructs. The exam usually rewards the answer that preserves continuity of management.

Quiz

Loading quiz…
Revised on Sunday, May 10, 2026