Question 270
A Terraform associate evaluates: An engineer assumes terraform fmt success guarantees the configuration works against the target provider. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The observed situation is: An engineer assumes terraform fmt success guarantees the configuration works against the target provider. The acceptance evidence is: The formatter reports only formatting changes and separate validate checks configuration correctness. It verifies the corrective approach (Run terraform fmt to apply canonical HCL layout without assuming it checks provider resource correctness.) and controls the risk: A consistently formatted file can still contain invalid references or unsupported provider attributes. Checking an unrelated Terraform setting would not prove the stated requirement was met.
The case says: An engineer assumes terraform fmt success guarantees the configuration works against the target provider. The directly relevant Terraform response is: Run terraform fmt to apply canonical HCL layout without assuming it checks provider resource correctness. This addresses the related failure mode: A consistently formatted file can still contain invalid references or unsupported provider attributes. Validate the result by checking: The formatter reports only formatting changes and separate validate checks configuration correctness. The selection matches this objective, rather than a different Terraform administration task.
Incorrect Answers
Use terraform fmt -check (optionally -recursive) to fail CI on noncanonical formatting without changing committed files. This is relevant to Formatting check in CI (official objective 3g). Its distinct failure risk is that automatically rewriting formatting during a read-only CI check can produce untracked repository changes. The present question tests Formatting Terraform HCL, which this measure alone does not establish.
A destroy operation can remove every managed object in the active configuration and state, not just temporary resources. That is the exact risk associated with Destroy with visibility into consequences (official objective 3f), not the required Formatting Terraform HCL outcome.
The initialized backend targets the approved new state location and existing bindings remain intact. This does not provide the required Formatting Terraform HCL action-and-evidence pair.