Question 900
At Duneland Cloud Operations, an authorized infrastructure engineering team manages a Terraform 1.12 and HCP Terraform environment. The team encounters the following situation: two CI jobs attempt to apply changes to the same remote state and one receives a lock error. Choose the technically best Terraform Associate 004 practice response to this particular infrastructure case. Which operational control addresses the risk long term?
Explanation
Correct Answer
Use shared state locks and controlled apply queues. This control addresses automatic backend state locking because a state lock protects against concurrent state writers that could corrupt mappings. The original implementation remedy remains: Allow backend-supported state locking and serialize the operations.
Incorrect Answers
This safeguard is for the dependency described by: Backend read capability alone does not prove locking and state write access are available. The continuing risk here is determined by: A state lock protects against concurrent state writers that could corrupt mappings. The targeted safeguard is “Use shared state locks and controlled apply queues”.
That review protects the control associated with: State and saved plan artifacts can carry sensitive values while describing differences. It does not directly prevent the stated recurrence, which concerns: A state lock protects against concurrent state writers that could corrupt mappings. The appropriate guardrail is “Use shared state locks and controlled apply queues”.
This safeguard is for the dependency described by: Providers can require destroy-and-recreate when a resource attribute cannot be changed in place. The continuing risk here is determined by: A state lock protects against concurrent state writers that could corrupt mappings. The targeted safeguard is “Use shared state locks and controlled apply queues”.