Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 110


What does state locking accomplish?

Show Answer
Correct Answer: C

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.

Discussion

11 comments
Sign in to comment
Uma10Option: C
Mar 1, 2024

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

chael88
Jul 29, 2024

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

phidelics
Sep 20, 2024

Not all backends supports state locking. you are right with option D

BurakkoOption: C
Mar 2, 2024

It just locks the state file not to be modified.

bora4motionOption: C
Mar 2, 2024

I go with C

barracoutoOption: C
Apr 12, 2024

I really wonder if exam topics needs to display the incorrect answers for legality purposes. It's C.

secdaddy
Jun 6, 2024

They're guessing at answers and then refining by croudsourcing answers from us

adoubanOption: C
Jun 12, 2024

C state locking is protect state file from modification at the same time

RVivekOption: C
Mar 26, 2024

Blocks Terraform commands from modifying the state file. Since already one command is doing a modification and mutiple simultaneous writes can make it inconsistant

legendary7
Mar 29, 2024

C-is the correct answer https://www.terraform.io/language/state/locking

asudhinOption: C
Apr 1, 2024

It's C

Power123
Sep 30, 2024

C is correct

Ni33Option: C
Nov 9, 2024

C is the right answer