What does state locking accomplish?
What does state locking accomplish?
State locking in Terraform blocks commands from modifying the state file to prevent multiple simultaneous writes, which could potentially corrupt the state. By ensuring that only one command can modify the state at a time, it maintains the consistency and integrity of the state file.
If supported by your backend, Terraform will lock your state for all operations that could write state. This prevents others from acquiring the lock and potentially corrupting your state. Source: https://www.terraform.io/language/state/locking
Just passed the exam. There was a similar question not listed here on ExamTopic: What backend types supports state locking? A. local B. None C. All D. Some I chose D. Some as according to Hashicorp document: "Not all backends support locking" Source: https://developer.hashicorp.com/terraform/language/state/backends
Not all backends supports state locking. you are right with option D
It just locks the state file not to be modified.
I really wonder if exam topics needs to display the incorrect answers for legality purposes. It's C.
They're guessing at answers and then refining by croudsourcing answers from us
I go with C
C state locking is protect state file from modification at the same time
C is the right answer
C is correct
It's C
C-is the correct answer https://www.terraform.io/language/state/locking
Blocks Terraform commands from modifying the state file. Since already one command is doing a modification and mutiple simultaneous writes can make it inconsistant