Skip to content
devops

State Locking

Terraform State Locking

Definition

State locking prevents multiple Terraform processes from simultaneously modifying the same state file, which could cause corruption or inconsistent infrastructure. Remote backends like S3 with DynamoDB, GCS, and Terraform Cloud provide locking mechanisms.

When a plan or apply is running, the state is locked and subsequent operations must wait or fail with an error.

Can this ship? Are we exposed? Can you prove it?

Every CISO is asking these three questions. We answer them with facts, not guesses, from repository to runtime.