I am trying to use basic terraform commands like plan
, but cannot because the terraform state is locked (see below.)
I know I am the only person or process interacting with this terraform instance, and see my name in the Who
line of the lock below. I think this probably happened when I pressed Ctrl-C
on a terraform prompt.
How do I unlock it?
$ terraform plan
╷
│ Error: Error acquiring the state lock
│
│ Error message: ConditionalCheckFailedException: The conditional request failed
│ Lock Info:
│ ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
│ Path: xxx
│ Operation: OperationTypePlan
│ Who: xxx
│ Version: 1.3.4
│ Created: 2022-11-15 19:51:21.368168706 +0000 UTC
│ Info:
│
│
│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the "-lock=false"
│ flag, but this is not recommended.
╵
To unlock the state without having to type confirmation: