Question 170
A Terraform associate evaluates: A command-line error indicates the working directory has not been initialized. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The observed situation is: A command-line error indicates the working directory has not been initialized. The acceptance evidence is: Initialization completes and the subsequent validate and plan commands find required dependencies. It verifies the corrective approach (Run terraform init in the root configuration directory to install required providers and child modules and initialize backend settings.) and controls the risk: Planning before initialization can fail due to unavailable plugins, modules or backend configuration. Checking an unrelated Terraform setting would not prove the stated requirement was met.
The case says: A command-line error indicates the working directory has not been initialized. The directly relevant Terraform response is: Run terraform init in the root configuration directory to install required providers and child modules and initialize backend settings. This addresses the related failure mode: Planning before initialization can fail due to unavailable plugins, modules or backend configuration. Validate the result by checking: Initialization completes and the subsequent validate and plan commands find required dependencies. The selection matches this objective, rather than a different Terraform administration task.
Incorrect Answers
Skipping plan review can execute an unintended destructive or replacement operation. That is the exact risk associated with Core plan-first workflow (official objective 3a), not the required Initialize module and provider dependencies outcome.
The apply uses the previously reviewed values and reports no unexpected input prompts or new plan. This addresses Saved plan application and input immutability (official objective 3e). The separate hazard is that changing inputs after plan generation cannot retroactively change the actions encoded in that saved artifact. It does not by itself satisfy the case-specific requirement for Initialize module and provider dependencies.
Use terraform init with the appropriate migration or reconfiguration option after changing backend configuration, following a backed-up state-migration plan. This does not provide the required Initialize module and provider dependencies action-and-evidence pair.