HashiCorp Certified: Terraform Associate — Question 248
What does state locking accomplish?
Answer options
- A. Copies the state file from memory to disk
- B. Encrypts any credentials stored within the state file
- C. Blocks Terraform commands from modifying the state file
- D. Prevents accidental deletion of the state file
Correct answer: C
Explanation
State locking is a mechanism that ensures that only one operation can modify the state file at a time, preventing potential conflicts and corrupted states. Options A and B describe different functionalities that are not related to state locking, while option D refers to protection against deletion rather than modification.