HashiCorp Certified: Terraform Associate — Question 163
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
Answer options
- A. Refresh the state after running Terraform
- B. Delete the state before running Terraform
- C. Configure state locking for your state backend
- D. Run Terraform with parallelism set to 1
Correct answer: C
Explanation
The correct answer is C because configuring state locking prevents multiple Terraform operations from accessing and altering the state file concurrently. Options A and B do not address the issue of concurrent access, while option D limits performance but does not prevent simultaneous changes to the state file.