DevOps · interactive
Terraform state and locking
Terraform keeps a state file mapping your code to real resources. It's how it knows what to change or delete. If two people apply at once without a lock, one can overwrite the other's state and lose track of real infrastructure.
Ana
idle
Ben
idle
terraform.tfstate (remote)
vpcdb
What actually exists in the cloud
vpcdb
The shared state file (in S3) records what Terraform created: a VPC and a database.
State locking
Step 1 of 4 · read left to right
In production
Tools and technologies
Remote state with locking is standard for any team using Terraform.
Not tied to one language — use these names when you search docs or design a system.