HashiCorp Terraform Associate (HashiCorp Certified: Terraform Associate) Practice Test 22

Question 210

An engineer needs to avoid inferring a successful future apply from successful static checks as part of a planned migration. Which option is the best fit?

  1. Use terraform fmt -check for formatting enforcement
  2. Recognize provider schema validation
  3. Interpret a clean validate as limited assurance
  4. Check for missing required variable values at planning time

Explanation

Correct Answer

C:

Provider API authorization, remote conflicts, and real infrastructure drift can still produce failures; validation checks supported configuration structure rather than deployment success; this behavior should be assessed against the concrete need to avoid inferring a successful future apply from successful static checks. This directly supports the task to avoid inferring a successful future apply from successful static checks during a maintenance request.

Incorrect Answers

A:

fmt -check exits nonzero when files need canonical formatting; it is a style check, not a replacement for Terraform semantic validation; this behavior should be assessed against the concrete need to avoid inferring a successful future apply from successful static checks. That can be useful when the aim is to detect code style deviations without rewriting files, but it does not directly deliver the requested ability to avoid inferring a successful future apply from successful static checks.

B:

Provider plugins supply schemas used for structural checking; passing validation does not mean the remote API will accept every eventual requested operation; this behavior should be assessed against the concrete need to avoid inferring a successful future apply from successful static checks. The distinction matters here: using that mechanism to detect unsupported resource arguments or incorrect types would still leave the objective to avoid inferring a successful future apply from successful static checks unmet.

D:

A variable declaration may be structurally valid even though a specific run has not supplied its required input; planning or applying requests those values when needed; this behavior should be assessed against the concrete need to avoid inferring a successful future apply from successful static checks. The stated requirement is to avoid inferring a successful future apply from successful static checks, not to understand why validation alone may pass with no values supplied; this alternative addresses a different control or phase.

Question 211

A reviewer is interpreting plan results before approval. The requirement is to recognize a planned destroy-and-create operation rather than an in-place edit. Which Terraform mechanism directly meets this requirement?

  1. Read -/+ as replacement intent
  2. Run terraform plan without applying
  3. Understand a (known after apply) value
  4. Use terraform plan -var-file=env.tfvars

Explanation

Correct Answer

A:

Some argument changes cannot be updated remotely and require a new object; replacement can have downtime implications unless ordering or architecture mitigates it; this behavior should be assessed against the concrete need to recognize a planned destroy-and-create operation rather than an in-place edit. This directly supports the task to recognize a planned destroy-and-create operation rather than an in-place edit during an automated release.

Incorrect Answers

B:

Plan evaluates dependencies and current state and reports create/update/replace/delete intentions; it normally performs no desired resource changes; this behavior should be assessed against the concrete need to recognize a planned destroy-and-create operation rather than an in-place edit. That can be useful when the aim is to preview the actions needed to reconcile the declared configuration, but it does not directly deliver the requested ability to recognize a planned destroy-and-create operation rather than an in-place edit.

C:

Computed provider attributes may be unknown until resource creation; terraform carries unknown values through dependent expressions rather than fabricating them; this behavior should be assessed against the concrete need to recognize a planned destroy-and-create operation rather than an in-place edit. The distinction matters here: using that mechanism to interpret an attribute whose value is not available during planning would still leave the objective to recognize a planned destroy-and-create operation rather than an in-place edit unmet.

D:

An explicitly selected tfvars file feeds input values into that run; a .tfvars file is not a provider dependency lock; this behavior should be assessed against the concrete need to recognize a planned destroy-and-create operation rather than an in-place edit. It may support a related workflow, but the question specifically requires the mechanism for recognize a planned destroy-and-create operation rather than an in-place edit rather than load an explicit environment input file.

Question 212

During a deployment checklist, one task is to execute the exact plan artifact rather than replan with new input values, while another is to prevent the run from waiting for interactive variable input. Select the matching pair of techniques.

  1. Run terraform apply tfplan for an approved saved plan + Run a new plan after unexpected apply behavior
  2. Run terraform apply tfplan for an approved saved plan + Use terraform apply -input=false in unattended execution
  3. Use terraform apply -auto-approve for controlled automation + Avoid concurrent applies against shared state
  4. Keep sensitive saved plans secure + Use terraform apply -input=false in unattended execution

Explanation

Correct Answer

B:

For the first criterion, applying a saved plan uses its captured decisions and state assumptions; a changed state can invalidate it instead of silently applying a different plan; this behavior should be assessed against the concrete need to execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input; this directly addresses the need to execute the exact plan artifact rather than replan with new input values. For the separate second criterion, the run fails if required input cannot be obtained in noninteractive mode; this avoids jobs hanging on missing variables; this behavior should be assessed against the concrete need to execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input; this fulfills the need to prevent the run from waiting for interactive variable input. Together they cover the independent tasks of execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to execute the exact plan artifact rather than replan with new input values, but its partner serves a different role: A subsequent plan refreshes tracked objects and identifies outstanding changes; blindly rerunning unrelated commands may hide the failure's scope; this behavior should be assessed against the concrete need to execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input. That second component is designed to reconcile the state and observed API results before taking further action, so the still-missing criterion is to prevent the run from waiting for interactive variable input, while the first criterion remains execute the exact plan artifact rather than replan with new input values.

C:

The first measure is intended to skip the interactive approval prompt when the pipeline already has gates: The option removes the manual confirmation stage; it is not an alternative to reviewing changes, securing credentials, or verifying policies; this behavior should be assessed against the concrete need to execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input. The second measure is intended to prevent two runs from racing to write incompatible snapshots: A locking-capable backend serializes state modifications; even with a lock, proper approvals and pipeline serialization remain important; this behavior should be assessed against the concrete need to execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input. Neither is the directly designated method for the separate goals of execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input in this review.

D:

The second measure does meet the prevent the run from waiting for interactive variable input requirement, but the first is designed for another concern: Plan files are not sanitized public reports; their embedded values and backend details require protective storage and restricted access; this behavior should be assessed against the concrete need to execute the exact plan artifact rather than replan with new input values and prevent the run from waiting for interactive variable input. That first component is designed to avoid leaking provider settings and input values through artifacts, which does not accomplish the requested task to execute the exact plan artifact rather than replan with new input values, even though the other measure satisfies prevent the run from waiting for interactive variable input.

Question 213

The immediate Terraform task is to plan and delete resources tracked by the current configuration and state. Which method handles that task most directly?

  1. Understand prevent_destroy during planned deletion
  2. Use terraform destroy for a managed deployment
  3. Understand cloud deletion protections
  4. Check the selected workspace before destroying

Explanation

Correct Answer

B:

Destroy requests deletion of Terraform-managed objects in the selected state; it does not search all cloud resources or remove unmanaged objects; this behavior should be assessed against the concrete need to plan and delete resources tracked by the current configuration and state. This directly supports the task to plan and delete resources tracked by the current configuration and state during a configuration change.

Incorrect Answers

A:

The lifecycle setting can make a normal destroy plan fail for a protected block; removing the block altogether removes the guard from evaluation; this behavior should be assessed against the concrete need to plan and delete resources tracked by the current configuration and state. The distinction matters here: using that mechanism to recognize a guard against destructive changes while the resource block remains configured would still leave the objective to plan and delete resources tracked by the current configuration and state unmet.

C:

Some services reject deletes while protection, retention, or dependencies remain; changing the HCL declaration alone does not override service-side restrictions; this behavior should be assessed against the concrete need to plan and delete resources tracked by the current configuration and state. The stated requirement is to plan and delete resources tracked by the current configuration and state, not to distinguish provider API refusal from Terraform syntax issues; this alternative addresses a different control or phase.

D:

Terraform operates on the selected state and current configuration; similar resource names in separate states can refer to entirely different real objects; this behavior should be assessed against the concrete need to plan and delete resources tracked by the current configuration and state. That can be useful when the aim is to avoid deleting resources belonging to a different environment, but it does not directly deliver the requested ability to plan and delete resources tracked by the current configuration and state.

Question 214

A Terraform rollout has separate acceptance criteria: recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior. Which combined approach directly satisfies the two criteria?

  1. Run terraform fmt -recursive + Run terraform fmt -diff
  2. Run terraform fmt in the working directory + Apply style checks to module directories
  3. Avoid treating formatting as infrastructure planning + Use standard indentation and alignment from fmt
  4. Avoid treating formatting as infrastructure planning + Apply style checks to module directories

Explanation

Correct Answer

D:

For the first criterion, a formatted file must still be evaluated by terraform plan to reveal resource changes; formatting commands do not contact APIs to execute changes; this behavior should be assessed against the concrete need to recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior; this directly addresses the need to recognize that whitespace changes are not a plan for cloud operations. For the separate second criterion, module source code is Terraform configuration and can be formatted with the same tool; formatting never pins which module release is used; this behavior should be assessed against the concrete need to recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior; this fulfills the need to enforce a consistent codebase without changing module behavior. Together they cover the independent tasks of recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to format Terraform configurations in nested directories: Recursive mode traverses child directories rather than just the current location; it is useful in repositories containing multiple roots and modules; this behavior should be assessed against the concrete need to recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior. The second measure is intended to display the textual adjustments a formatter would make: Diff mode shows the before-and-after formatting changes; it cannot indicate whether a proposed resource change is safe; this behavior should be assessed against the concrete need to recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior. Neither is the directly designated method for the separate goals of recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior in this review.

B:

The second measure does meet the enforce a consistent codebase without changing module behavior requirement, but the first is designed for another concern: The formatter adjusts layout and spacing according to Terraform conventions; it does not modify remote infrastructure or update state; this behavior should be assessed against the concrete need to recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior. That first component is designed to rewrite Terraform files into canonical HCL style, which does not accomplish the requested task to recognize that whitespace changes are not a plan for cloud operations, even though the other measure satisfies enforce a consistent codebase without changing module behavior.

C:

The first measure meets the requirement to recognize that whitespace changes are not a plan for cloud operations, but its partner serves a different role: Canonical layout gives team members predictable formatting; hand-crafted alignment rules are not necessary to make Terraform parse HCL correctly; this behavior should be assessed against the concrete need to recognize that whitespace changes are not a plan for cloud operations and enforce a consistent codebase without changing module behavior. That second component is designed to reduce noisy diff conflicts across contributors, so the still-missing criterion is to enforce a consistent codebase without changing module behavior, while the first criterion remains recognize that whitespace changes are not a plan for cloud operations.

Question 215

A Terraform rollout has separate acceptance criteria: identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure. Which combined approach directly satisfies the two criteria?

  1. Validate configuration before requesting a plan + Apply reviewed changes with terraform apply
  2. Keep environment state separated + Use version control alongside the workflow
  3. Avoid applying an outdated reviewed plan + Apply reviewed changes with terraform apply
  4. Preview changes with terraform plan + Apply reviewed changes with terraform apply
  5. Validate configuration before requesting a plan + Initialize the working directory before planning

Explanation

Correct Answer

A:

For the first criterion, validation checks the HCL configuration against available schemas; it is useful in CI but cannot replace a plan based on actual state and provider data; this behavior should be assessed against the concrete need to identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure; this directly addresses the need to identify structural issues early in a workflow. For the separate second criterion, 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 identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure; this fulfills the need to execute the actions Terraform has selected for managed infrastructure. Together they cover the independent tasks of identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure without exchanging the responsibilities of these features.

Incorrect Answers

B:

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 identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure. The second measure is intended to make infrastructure edits traceable and reviewable: Git captures code changes and supports peer review; Terraform state and provider API results remain separate operational concerns; this behavior should be assessed against the concrete need to identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure. Neither is the directly designated method for the separate goals of identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure in this review.

C:

The second measure does meet the execute the actions Terraform has selected for managed infrastructure requirement, but the first is designed for another concern: 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 identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure. That first component is designed to ensure the approved actions still correspond to current state, which does not accomplish the requested task to identify structural issues early in a workflow, even though the other measure satisfies execute the actions Terraform has selected for managed infrastructure.

D:

The second measure does meet the execute the actions Terraform has selected for managed infrastructure requirement, but the first is designed for another concern: 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 identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure. That first component is designed to inspect intended create, change, and delete actions before execution, which does not accomplish the requested task to identify structural issues early in a workflow, even though the other measure satisfies execute the actions Terraform has selected for managed infrastructure.

E:

The first measure meets the requirement to identify structural issues early in a workflow, but its partner serves a different role: 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 identify structural issues early in a workflow and execute the actions Terraform has selected for managed infrastructure. That second component is designed to prepare backend, providers, and external module dependencies, so the still-missing criterion is to execute the actions Terraform has selected for managed infrastructure, while the first criterion remains identify structural issues early in a workflow.

Question 216

A Terraform backend has just been changed. The team must both recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. Which paired choice implements those distinct goals?

  1. Use terraform init -migrate-state + Reinitialize after changing provider requirements
  2. Inspect .terraform/ as generated local metadata + Reinitialize after changing provider requirements
  3. Inspect .terraform/ as generated local metadata + Reinitialize after adding a module source
  4. Use terraform init -upgrade + Reinitialize after changing provider requirements
  5. Use terraform init -input=false in automation + Use terraform init -get=false
  6. Inspect .terraform/ as generated local metadata + Use terraform init -backend=false cautiously

Explanation

Correct Answer

B:

For the first criterion, the directory can hold installed modules, provider metadata, and backend configuration; it should normally be excluded from Git and may contain sensitive settings; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints; this directly addresses the need to recognize initialization artifacts rather than versioned source. For the separate second criterion, init reconciles the plugin installation and lock selections after changes in required_providers; running only fmt cannot install a newly required plugin; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints; this fulfills the need to pick up new dependencies and version constraints. Together they cover the independent tasks of recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the pick up new dependencies and version constraints requirement, but the first is designed for another concern: Migration attempts to move state into the newly configured backend; backups and confirmation are important before switching active state locations; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. That first component is designed to copy existing state when changing storage backends, which does not accomplish the requested task to recognize initialization artifacts rather than versioned source, even though the other measure satisfies pick up new dependencies and version constraints.

C:

The first measure meets the requirement to recognize initialization artifacts rather than versioned source, but its partner serves a different role: Init downloads module packages from their sources; merely declaring a module block does not put remote module code onto disk; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. That second component is designed to fetch externally sourced child module code, so the still-missing criterion is to pick up new dependencies and version constraints, while the first criterion remains recognize initialization artifacts rather than versioned source.

D:

The second measure does meet the pick up new dependencies and version constraints requirement, but the first is designed for another concern: Upgrade requests reconsideration of versions within declared constraints; it changes dependency selections, not infrastructure objects by itself; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. That first component is designed to reselect newer eligible provider and module packages, which does not accomplish the requested task to recognize initialization artifacts rather than versioned source, even though the other measure satisfies pick up new dependencies and version constraints.

E:

The first measure is intended to disallow interactive answers during initialization: Noninteractive jobs fail instead of waiting for a prompt when required values cannot be supplied; this supports predictable CI behavior; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. The second measure is intended to skip installing child modules in a prepared directory: This option avoids module download/update during initialization; it is appropriate only when required modules are already available; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. Neither is the directly designated method for the separate goals of recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints in this review.

F:

The first measure meets the requirement to recognize initialization artifacts rather than versioned source, but its partner serves a different role: Disabling backend setup avoids configuring remote state, but some later operations require an initialized backend; it does not create a temporary safe state automatically; this behavior should be assessed against the concrete need to recognize initialization artifacts rather than versioned source and pick up new dependencies and version constraints. That second component is designed to skip backend initialization for a specific preparation task, so the still-missing criterion is to pick up new dependencies and version constraints, while the first criterion remains recognize initialization artifacts rather than versioned source.

Question 217

A reviewer wants to distinguish syntax validation from runtime checks. The requirement is to reject invalid user-supplied values with a targeted message. Which Terraform mechanism directly meets this requirement?

  1. Check expression references for validity
  2. Use preconditions for runtime assumptions
  3. Check for missing required variable values at planning time
  4. Use variable validation for input contracts

Explanation

Correct Answer

D:

The validation rule belongs to the variable declaration and returns a Boolean; it is distinct from the CLI's whole-configuration validation subcommand; this behavior should be assessed against the concrete need to reject invalid user-supplied values with a targeted message. This directly supports the task to reject invalid user-supplied values with a targeted message during an automated release.

Incorrect Answers

A:

Terraform validates the structure of expressions against known configuration objects; values only resolved by providers may remain unknown until later phases; this behavior should be assessed against the concrete need to reject invalid user-supplied values with a targeted message. The distinction matters here: using that mechanism to catch references to undeclared blocks and invalid attributes where detectable would still leave the objective to reject invalid user-supplied values with a targeted message unmet.

B:

A lifecycle precondition can validate context-dependent values before acting on a resource; a general syntax check alone cannot confirm runtime facts; this behavior should be assessed against the concrete need to reject invalid user-supplied values with a targeted message. It may support a related workflow, but the question specifically requires the mechanism for reject invalid user-supplied values with a targeted message rather than enforce environment-specific prerequisites that static validation cannot prove.

C:

A variable declaration may be structurally valid even though a specific run has not supplied its required input; planning or applying requests those values when needed; this behavior should be assessed against the concrete need to reject invalid user-supplied values with a targeted message. The stated requirement is to reject invalid user-supplied values with a targeted message, not to understand why validation alone may pass with no values supplied; this alternative addresses a different control or phase.

Question 218

An operator is preparing a controlled Terraform change. A reviewer must determine how to override an input variable for one planned run. Which action is the appropriate choice?

  1. Use terraform show tfplan
  2. Use terraform plan -refresh=false carefully
  3. Use terraform plan -var='name=value'
  4. Read ~ as in-place update intent

Explanation

Correct Answer

C:

CLI variable arguments supply run-specific values; they do not permanently modify the variable declaration or backend configuration; this behavior should be assessed against the concrete need to override an input variable for one planned run. This directly supports the task to override an input variable for one planned run during a staged rollout.

Incorrect Answers

A:

Show decodes the saved plan for review; it does not run the provider operations represented by the plan; this behavior should be assessed against the concrete need to override an input variable for one planned run. That can be useful when the aim is to render a saved execution plan in readable form, but it does not directly deliver the requested ability to override an input variable for one planned run.

B:

Skipping remote refresh can produce an inaccurate plan when out-of-band changes have occurred; it is not a drift-detection strategy; this behavior should be assessed against the concrete need to override an input variable for one planned run. The distinction matters here: using that mechanism to omit the usual state refresh while creating an ordinary plan would still leave the objective to override an input variable for one planned run unmet.

D:

The plan symbol indicates updating a tracked resource without replacing its identity; whether a particular field supports this depends on the provider; this behavior should be assessed against the concrete need to override an input variable for one planned run. The stated requirement is to override an input variable for one planned run, not to distinguish modification of an existing object from creation or destruction; this alternative addresses a different control or phase.

Question 219

The immediate Terraform task is to force a targeted resource to be replaced during an ordinary apply. Which method handles that task most directly?

  1. Use terraform apply -input=false in unattended execution
  2. Run a new plan after unexpected apply behavior
  3. Use terraform apply -replace=ADDRESS for an intentional rebuild
  4. Keep sensitive saved plans secure

Explanation

Correct Answer

C:

The CLI adds a replacement request to the plan it creates; a saved plan should instead be prepared with the replacement request at planning time; this behavior should be assessed against the concrete need to force a targeted resource to be replaced during an ordinary apply. This directly supports the task to force a targeted resource to be replaced during an ordinary apply during a configuration change.

Incorrect Answers

A:

The run fails if required input cannot be obtained in noninteractive mode; this avoids jobs hanging on missing variables; this behavior should be assessed against the concrete need to force a targeted resource to be replaced during an ordinary apply. The stated requirement is to force a targeted resource to be replaced during an ordinary apply, not to prevent the run from waiting for interactive variable input; this alternative addresses a different control or phase.

B:

A subsequent plan refreshes tracked objects and identifies outstanding changes; blindly rerunning unrelated commands may hide the failure's scope; this behavior should be assessed against the concrete need to force a targeted resource to be replaced during an ordinary apply. That can be useful when the aim is to reconcile the state and observed API results before taking further action, but it does not directly deliver the requested ability to force a targeted resource to be replaced during an ordinary apply.

D:

Plan files are not sanitized public reports; their embedded values and backend details require protective storage and restricted access; this behavior should be assessed against the concrete need to force a targeted resource to be replaced during an ordinary apply. It may support a related workflow, but the question specifically requires the mechanism for force a targeted resource to be replaced during an ordinary apply rather than avoid leaking provider settings and input values through artifacts.

Question 220

In an automated release, the requested result is to avoid assuming Terraform can restore deleted provider objects from state alone. What should the engineer select?

  1. Preserve required records before teardown
  2. Use terraform plan -destroy for teardown review
  3. Remove a resource from state without destroying it
  4. Inspect dependencies during teardown

Explanation

Correct Answer

A:

State is a management map, not a full backup of application data or cloud resources; deletion may be irreversible without separate backups; this behavior should be assessed against the concrete need to avoid assuming Terraform can restore deleted provider objects from state alone. This directly supports the task to avoid assuming Terraform can restore deleted provider objects from state alone during a module implementation.

Incorrect Answers

B:

A destroy plan lists what would be removed and can be saved for approval; it is appropriate before potentially disruptive cleanup; this behavior should be assessed against the concrete need to avoid assuming Terraform can restore deleted provider objects from state alone. The stated requirement is to avoid assuming Terraform can restore deleted provider objects from state alone, not to preview the deletions without executing them; this alternative addresses a different control or phase.

C:

terraform state rm or a supported removed block can forget an object; it is different from instructing a provider to delete infrastructure; this behavior should be assessed against the concrete need to avoid assuming Terraform can restore deleted provider objects from state alone. That can be useful when the aim is to stop Terraform management while leaving a real object intact, but it does not directly deliver the requested ability to avoid assuming Terraform can restore deleted provider objects from state alone.

D:

Terraform reverses dependency relationships where necessary to delete objects safely; explicit and implicit graph edges influence safe order; this behavior should be assessed against the concrete need to avoid assuming Terraform can restore deleted provider objects from state alone. The distinction matters here: using that mechanism to understand why child objects may be destroyed before prerequisites would still leave the objective to avoid assuming Terraform can restore deleted provider objects from state alone unmet.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests