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.
| 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 |
| 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 |
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.