HashiCorp Certified: Terraform Associate (003) — Question 32
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
Answer options
- A. Delete the state before running Terraform.
- B. Refresh the state after running Terraform.
- C. Run Terraform with parallelism set to 1.
- D. Configure state locking for your state backend.
Correct answer: D
Explanation
The correct answer is D because configuring state locking prevents concurrent operations on the same state file, ensuring that only one process can modify it at a time. Options A and B do not address concurrent access, and option C limits parallelism but does not provide a safeguard against overlapping runs.