Question 240
A Terraform associate evaluates: A deployment script must distinguish terraform apply with and without a saved plan path. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A deployment script must distinguish terraform apply with and without a saved plan path. The directly relevant Terraform response is: Apply an approved saved plan with terraform apply planfile rather than attempting to pass fresh input variables to the saved plan. This addresses the related failure mode: Changing inputs after plan generation cannot retroactively change the actions encoded in that saved artifact. Validate the result by checking: The apply uses the previously reviewed values and reports no unexpected input prompts or new plan. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A deployment script must distinguish terraform apply with and without a saved plan path. The acceptance evidence is: The apply uses the previously reviewed values and reports no unexpected input prompts or new plan. It verifies the corrective approach (Apply an approved saved plan with terraform apply planfile rather than attempting to pass fresh input variables to the saved plan.) and controls the risk: Changing inputs after plan generation cannot retroactively change the actions encoded in that saved artifact. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
The destruction plan lists only the intended disposable environment resources and approval is recorded. This is relevant to Destroy with visibility into consequences (official objective 3f). Its distinct failure risk is that a destroy operation can remove every managed object in the active configuration and state, not just temporary resources. The present question tests Saved plan application and input immutability, which this measure alone does not establish.
A consistently formatted file can still contain invalid references or unsupported provider attributes. This addresses Formatting Terraform HCL (official objective 3g). The separate hazard is that a consistently formatted file can still contain invalid references or unsupported provider attributes. It does not by itself satisfy the case-specific requirement for Saved plan application and input immutability.
Run terraform apply only after reviewing the proposed plan and ensuring appropriate cloud credentials and authorization. This does not provide the required Saved plan application and input immutability action-and-evidence pair.