Terraform State File Structure and Resource Identity

Terraform state is not just a backup file.

State is Terraform’s memory system. It stores resource identity, provider-returned attributes, instance mappings, outputs, and snapshot metadata that Terraform uses during planning and reconciliation.

This lesson breaks down the internal structure of the state file, including serial numbers, lineage, resource addresses, for_each instance tracking, drift detection, backend storage, and state locking behavior.

The goal is to explain why Terraform depends on state consistency to safely manage infrastructure over time.