Terraform
Terraform State
Appears inTerraform Associate
A file (terraform.tfstate) that Terraform uses to map the real-world configuration in code to actual resources in the cloud. It's Terraform's source of truth about which resources it manages and their current status.
On the exam
A critical topic in Terraform Associate. State can be stored locally or in remote backends (S3, Azure Blob, HCP Terraform). Never manually edit the tfstate. Question: what happens if you lose the state file? Terraform loses track of existing resources.
Related terms
- Terraform BackendA configuration that defines where Terraform state is stored. Remote backends (S3, Azure Blob Storage, HCP Terraform) enable team collaboration and state locking to avoid conflicts.
- Terraform PlanA command that generates and displays an execution plan without applying any changes. It compares the desired configuration with the current state and shows which resources will be created, modified, or destroyed.