Study HashiCorp Terraform 004 Local State and Backends: key concepts, common traps, and exam decision cues.
Terraform state records what Terraform manages and how configuration maps to real objects. The backend decides where that state is stored and how it is accessed. Those are related ideas, but they are not the same thing.
| Concept | Main job |
|---|---|
| state | record managed objects and their mapping |
| backend | determine where state is stored and accessed |
| local backend | keep state in a local file on the machine running Terraform |
| Trap | Better rule |
|---|---|
| saying the backend talks to the cloud platform | providers talk to platforms; backends store state |
| saying local state means Terraform has no state | local backend still means Terraform has state, just stored locally |
| confusing backend config with resource config | backend concerns state handling, not infrastructure definition |
State questions usually start with one distinction: providers manage platforms, but backends manage state storage. Then ask whether the state is stored locally or remotely. Local state is simple but weak for team collaboration. The exam often tests whether you can keep state purpose separate from provider and module behavior.