Interview Prep/Terraform/IaC and Terraform Fundamentals

What is the Terraform state file and why does it exist?

BeginnerConceptIaC and Terraform Fundamentals
Answer

State (terraform.tfstate) is a JSON file mapping each resource in your config to the real object ID in the cloud, plus attributes and metadata. Terraform needs it to know what it already manages, to compute diffs, to order destroys and to avoid slow lookups of everything on every plan. Without state, Terraform cannot tell a resource it created from one that already existed.

All Terraform questions Roadmap: Terraform

More on IaC and Terraform Fundamentals