Which of the below ...
 
Notifications
Clear all

Which of the below commands can be used to remove the already acquired lock on the state?

1 Posts
1 Users
0 Likes
70 Views
(@monvillemauro)
Posts: 721
Noble Member
Topic starter
 

You are using a terraform operation that writes state. Unfortunately automatic state unlocking has failed for that operation.

Which of the below commands can be used to remove the already acquired lock on the state?

  • A . terraform unlock
    B. terraform force-unlock
    C. terraform state unlock
    D. None of the above

Show Answer Hide Answer

Suggested Answer: B

Explanation:

Command: force-unlock

Manually unlock the state for the defined configuration.

This will not modify your infrastructure. This command removes the lock on the state for the current configuration. The behavior of this lock is dependent on the backend being used. Local state files cannot be unlocked by another process. https://www.terraform.io/docs/commands/force-unlock.html https://www.terraform.io/docs/state/locking.html

Terraform has a force-unlock command to manually unlock the state if unlocking failed. If you unlock the state when someone else is holding the lock it could cause multiple writers. Force unlock should only be used to unlock your own lock in the situation where automatic unlocking failed.
 
Posted : 01/11/2022 4:53 pm

Latest TA-002-P V1 Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: