Study HashiCorp Terraform 003 Import and Drift: key concepts, common traps, and exam decision cues.
This lesson matters because Terraform maintenance questions are usually about who changed what and how Terraform should react. Import, drift, and replacement are related, but they are not the same operation.
| Requirement | Strongest first fit |
|---|---|
| bring an existing resource under Terraform management | import |
| detect or reconcile out-of-band change | drift handling |
| intentionally recreate one resource | -replace |
-replace when recreation is intentional.| Trap | Better rule |
|---|---|
| assuming import means Terraform created the object | import adopts management |
| treating drift like a provider bug by default | drift often means reality changed outside Terraform |
| using destructive fixes before understanding the diff | inspect plan and state first |