Skill 6.2.2
Lock timeouts and force-unlock
Key Concepts
-lock-timeout=5m tells Terraform to retry for up to five minutes instead of failing at once, which helps in pipelines where runs may overlap briefly. -lock=false disables locking for one command; it is dangerous and should be used only when you are certain no one else is running Terraform.
If a process crashes or loses its network connection, the lock can remain. terraform force-unlock LOCK_ID removes it after a confirmation prompt. It only releases the lock; it does not change infrastructure or state. Use it only after confirming that the run holding the lock has really stopped, or two runs may write state at once.