When and how do you use `terraform force-unlock`?
IntermediateConceptState Internals
Answer
When a crashed run or killed CI job leaves a stale lock. Confirm nobody is actually running, then terraform force-unlock <LOCK_ID> using the ID from the error. With S3 native locking you can also remove the .tflock object. Never force-unlock while a legitimate apply is running.
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?BeginnerWhat is state locking and why does it matter?IntermediateHow does S3-native locking work and how does it replace DynamoDB?AdvancedHow do you inspect resources in state?Beginner