What is state locking and why does it matter?
IntermediateConceptState Internals
Answer
When a command that can write state starts, Terraform takes a lock so two runs cannot modify the same state concurrently, which would corrupt it or create duplicate resources. A second run fails with Error acquiring the state lock and shows who holds it. Local state locks via a file, remote backends via their own mechanism.
More on State Internals
What does the state file contain?BeginnerWhat is the difference between local and remote state?BeginnerHow do you configure the S3 backend?BeginnerHow does S3-native locking work and how does it replace DynamoDB?AdvancedHow do you inspect resources in state?BeginnerWhen do you use `terraform state mv`?Intermediate