Question 180
A Terraform rollout has separate acceptance criteria: prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution. Which combined approach directly satisfies the two criteria?
Explanation
Correct Answer
For the first criterion, terraform init sets up the directory so subsequent validation, planning, and applying can use the correct plugins and backend; initialization itself does not deploy resources; this behavior should be assessed against the concrete need to prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution; this directly addresses the need to prepare backend, providers, and external module dependencies. For the separate second criterion, planning compares desired configuration with current state and provider observations; no planned infrastructure actions are applied by the plan command; this behavior should be assessed against the concrete need to prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution; this fulfills the need to inspect intended create, change, and delete actions before execution. Together they cover the independent tasks of prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution without exchanging the responsibilities of these features.
Incorrect Answers
The second measure does meet the inspect intended create, change, and delete actions before execution requirement, but the first is designed for another concern: Apply coordinates provider operations and updates state after effects are known; it needs valid authentication and can still fail if the API rejects an operation; this behavior should be assessed against the concrete need to prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution. That first component is designed to execute the actions Terraform has selected for managed infrastructure, which does not accomplish the requested task to prepare backend, providers, and external module dependencies, even though the other measure satisfies inspect intended create, change, and delete actions before execution.
The first measure meets the requirement to prepare backend, providers, and external module dependencies, but its partner serves a different role: Formatting, validation, and policy checks can gate promotion; they do not guarantee real cloud capacity or authorization at execution time; this behavior should be assessed against the concrete need to prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution. That second component is designed to reduce risk by verifying syntax and policy before deploying, so the still-missing criterion is to inspect intended create, change, and delete actions before execution, while the first criterion remains prepare backend, providers, and external module dependencies.
The first measure is intended to ensure independent deployments do not accidentally share object bindings: Multiple root working directories or CLI workspaces can carry different states; the isolation of state prevents Terraform from treating two environments as one inventory; this behavior should be assessed against the concrete need to prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution. The second measure is intended to ensure the approved actions still correspond to current state: Saved plans encode assumptions about the state snapshot and inputs; if the state changes, applying a stale plan may be rejected rather than silently reinterpreted; this behavior should be assessed against the concrete need to prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution. Neither is the directly designated method for the separate goals of prepare backend, providers, and external module dependencies and inspect intended create, change, and delete actions before execution in this review.