Question 540
A Terraform associate evaluates: A platform team needs to explain why locking protects shared state consistency. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The observed situation is: A platform team needs to explain why locking protects shared state consistency. The acceptance evidence is: A second state-changing run waits or fails on the lock instead of proceeding concurrently. It verifies the corrective approach (Use a backend that supports locking and let Terraform acquire its automatic lock during state-changing operations.) and controls the risk: Two simultaneous applies against one unlocked state can overwrite each other's resource bindings or corrupt management. Checking an unrelated Terraform setting would not prove the stated requirement was met.
The case says: A platform team needs to explain why locking protects shared state consistency. The directly relevant Terraform response is: Use a backend that supports locking and let Terraform acquire its automatic lock during state-changing operations. This addresses the related failure mode: Two simultaneous applies against one unlocked state can overwrite each other's resource bindings or corrupt management. Validate the result by checking: A second state-changing run waits or fails on the lock instead of proceeding concurrently. The selection matches this objective, rather than a different Terraform administration task.
Incorrect Answers
A new local configuration has its state file on disk, and team requirements indicate whether remote storage is needed. This is relevant to Default local backend state storage (official objective 6a). Its distinct failure risk is that local state stored only on one laptop is hard for a team to coordinate and can be lost or leaked. The present question tests Automatic state locking for conflicting writers, which this measure alone does not establish.
Use terraform force-unlock only for your own stale lock after confirming no legitimate operation still holds it. This addresses Force-unlock safety (official objective 6b). The separate hazard is that forcibly unlocking an active run can permit concurrent writers and corrupt resource state. It does not by itself satisfy the case-specific requirement for Automatic state locking for conflicting writers.
Confusing refresh-only with a normal corrective plan can leave configuration drift unresolved or record unintended state updates. This does not provide the required Automatic state locking for conflicting writers action-and-evidence pair.