Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 259

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

    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
DevoteamAnalytixOption: C

"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