Question 630
A Terraform associate evaluates: An operator wants to choose a documented moved block instead of manually rewriting state JSON. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: An operator wants to choose a documented moved block instead of manually rewriting state JSON. The directly relevant Terraform response is: Use moved blocks or state mv for renames that preserve management, and state rm only when deliberately ceasing to manage an object without destroying it. This addresses the related failure mode: Removing a binding when intending only a resource rename can cause Terraform to plan duplicate resources. Validate the result by checking: A refactored address retains the same remote object binding and no unnecessary destroy-create action appears. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: An operator wants to choose a documented moved block instead of manually rewriting state JSON. The acceptance evidence is: A refactored address retains the same remote object binding and no unnecessary destroy-create action appears. It verifies the corrective approach (Use moved blocks or state mv for renames that preserve management, and state rm only when deliberately ceasing to manage an object without destroying it.) and controls the risk: Removing a binding when intending only a resource rename can cause Terraform to plan duplicate resources. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
A declared resource that matches a preexisting object is not automatically tracked unless imported or otherwise bound. This belongs to Import block declarative adoption (official objective 7a). Its separate risk is that a declared resource that matches a preexisting object is not automatically tracked unless imported or otherwise bound. The question instead tests State mv versus state rm and moved blocks; that other safeguard alone does not verify it.
Use terraform state list to enumerate tracked addresses and terraform state show ADDRESS to inspect a specific object safely. That addresses Inspect state list and show (official objective 7b), specifically the hazard that guessing resource bindings from cloud consoles without inspecting state can target the wrong Terraform address. Here the necessary action or evidence is the paired action Use moved blocks or state mv for renames that preserve management, and state rm only when deliberately ceasing to manage an object without destroying and separate validation A refactored address retains the same remote object binding and no unnecessary destroy-create action appears, not that separate control.
The designated log file captures the relevant run and is stored under approved short-lived restricted access. This addresses TF_LOG_PATH debug log file handling (official objective 7c). The separate hazard is that logs containing resource attributes and credentials should not be committed to Git or left in public CI artifacts. It does not by itself satisfy the case-specific requirement for State mv versus state rm and moved blocks.