Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 259


Which of these actions will prevent two Terraform runs from changing the same state file at the same time?

Show Answer
Correct Answer: C

To prevent two Terraform runs from changing the same state file at the same time, you should configure state locking for your state backend. State locking ensures that operations that could potentially write to the state are serialized, meaning only one operation can modify the state at a given time. This prevents concurrent operations from corrupting the state file.

Discussion

2 comments
Sign in to comment
DevoteamAnalytixOption: C
Jun 26, 2023

"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." https://developer.hashicorp.com/terraform/language/state/locking

090200fOption: C
Aug 2, 2024

will prevent to change something in state file means state locking is the correct answer so option C is the correct answer