Recovering terraform state after accidentally deletion and lock

Viewed 337

I previously had my terraform.tfstate locally and accidentally deleted it. I've now moved it to gitlab's http backend and am trying to import my resources to get it back.

I'm running

terraform import "module.mymodule.acl" acl-xxx123

but getting the error

 Error: Error acquiring the state lock
│
│ Error message: Unexpected HTTP response code 308
│
│ 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

I can't see a way of forcing an unlock without a lock ID. Is there a way to force unlock this to recover the state?

0 Answers
Related