Interview Prep/Terraform/State Internals

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.

All Terraform questions Roadmap: Terraform in production

More on State Internals