HashiCorp Terraform Associate 004 Practice Test 21 - Prepaway
Practice Exams:

Pass HashiCorp Terraform Associate 004 Exam in First Attempt Guaranteed!

Get 100% Latest Exam Questions, Accurate & Verified Answers!

30 Days Free Updates, Instant Download!

Verified By Experts
Premium Bundle
$29.98
$79.99 $109.97

Terraform Associate 004 Premium Bundle


  • Premium File 167 Questions & Answers. Last update: Nov 28, 2026
  • Training Course 118 Lectures
  • Study Guide 285 Pages

HashiCorp Terraform Associate 004 Practice Test 21

Question 200

During an authorized design and operations review at a manufacturing supply-chain platform, engineers supporting vendor ordering and inventory APIs discover that a team approves a human-readable plan and later runs terraform apply against a newly generated plan after the repository changes. The team proposes to generate a saved plan with terraform plan -out and apply the vetted plan artifact under change control. The recommendation must address the demonstrated ML failure without an unrelated pipeline redesign. Which post-change observation would establish the required infrastructure or configuration outcome?

  1. CI detects formatting deviations without silently modifying committed source
  2. Invalid HCL never reaches apply and the corrected configuration passes validation
  3. The next successful apply converges on desired configuration without recreating already tracked objects
  4. The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run

Explanation

Correct Answer

D:

The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run. A saved Terraform plan can bind an approved decision to a specific proposed change set. Generate a saved plan with terraform plan -out and apply the vetted plan artifact under change control.

Incorrect Answers

A:

CI detects formatting deviations without silently modifying committed source. The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run.

B:

Invalid HCL never reaches apply and the corrected configuration passes validation. The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run. A saved Terraform plan can bind an approved decision to a specific proposed change set.

C:

The next successful apply converges on desired configuration without recreating already tracked objects. The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run.

Question 201

At a renewable energy company, a change advisory board is reviewing ML input and inference paths for field asset operations and grid analytics. The reported issue is that a developer syncs an unencrypted local terraform.tfstate file into a shared project folder. The proposed remedy is to restrict state file permissions and move to an approved secured backend with retention controls. Service owners require a reproducible result without unsafe or unapproved production testing. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?

  1. File inspection shows provider attributes and sensitive infrastructure data readable by unrelated collaborators
  2. State still maps the old root address and the module reference has a different new address
  3. Plan for staging shows destructive changes on production resource IDs
  4. Runner audit shows an active workflow and lock ID belonging to the current legitimate writer

Explanation

Correct Answer

A:

File inspection shows provider attributes and sensitive infrastructure data readable by unrelated collaborators. A developer syncs an unencrypted local terraform.tfstate file into a shared project folder. Restrict state file permissions and move to an approved secured backend with retention controls.

Incorrect Answers

B:

State still maps the old root address and the module reference has a different new address. Restrict state file permissions and move to an approved secured backend with retention controls.

C:

Plan for staging shows destructive changes on production resource IDs. File inspection shows provider attributes and sensitive infrastructure data readable by unrelated collaborators. Restrict state file permissions and move to an approved secured backend with retention controls.

D:

Runner audit shows an active workflow and lock ID belonging to the current legitimate writer. At a renewable energy company, file inspection shows provider attributes and sensitive infrastructure data readable by unrelated collaborators. Restrict state file permissions and move to an approved secured backend with retention controls.

Question 202

For metering and outage response at an energy infrastructure operator, the infrastructure platform team is investigating the following incident: an operator changes an instance size outside Terraform and an unchanged HCL plan unexpectedly proposes an update. Confirming evidence shows that provider refresh reports live instance size differs from the tracked configuration. The team must preserve approved data handling and avoid widening access to sensitive features. Which implementation paired with its verification outcome addresses the same fault?

  1. Review drift evidence and decide whether to restore declared state or adopt an approved new configuration — verify: Only authorized operators can access state and old insecure copies are remediated
  2. Review drift evidence and decide whether to restore declared state or adopt an approved new configuration — verify: The approved plan reconciles drift without unreviewed destruction
  3. Review drift evidence and decide whether to restore declared state or adopt an approved new configuration — verify: Separate runs read the same authoritative state and no duplicate resources are proposed
  4. Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive — verify: The active apply is not interrupted and stale locks are removed only under a controlled incident record

Explanation

Correct Answer

B:

Review drift evidence and decide whether to restore declared state or adopt an approved new configuration. The approved plan reconciles drift without unreviewed destruction. Provider refresh reports live instance size differs from the tracked configuration. Terraform compares desired configuration with refreshed remote objects and recorded state to detect drift.

Incorrect Answers

A:

Review drift evidence and decide whether to restore declared state or adopt an approved new configuration. Only authorized operators can access state and old insecure copies are remediated. That uses the intended change yet measures the wrong result. The approved plan reconciles drift without unreviewed destruction.

C:

Review drift evidence and decide whether to restore declared state or adopt an approved new configuration. Separate runs read the same authoritative state and no duplicate resources are proposed. The intervention addresses the fault, but the proposed test checks a different outcome. The approved plan reconciles drift without unreviewed destruction.

D:

Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive. The active apply is not interrupted and stale locks are removed only under a controlled incident record. This pair concerns a different control or outcome, leaving the recorded fault unresolved. Review drift evidence and decide whether to restore declared state or adopt an approved new configuration; The approved plan reconciles drift without unreviewed destruction.

Question 203

During an authorized design and operations review at a food distribution operator, engineers supporting warehouse and supply chain services discover that a module declaration adds version=1.2.0 while its source is a Git URL rather than a registry address. The team proposes to pin Git source through a supported ref query or migrate to the registry module syntax. Only a controlled and reversible ML workflow change fits the approved release window. Which post-change observation would establish the required infrastructure or configuration outcome?

  1. The child receives approved values without accessing caller-only locals
  2. Clean initialization retrieves the same approved module revision until an explicit upgrade
  3. Initialization fetches the intended source revision with a supported versioning mechanism
  4. The approved module version downloads for entitled workspaces and unauthorized consumers remain blocked

Explanation

Correct Answer

C:

Initialization fetches the intended source revision with a supported versioning mechanism. Terraform module version metadata differs between registry source addresses and VCS refs. Pin Git source through a supported ref query or migrate to the registry module syntax.

Incorrect Answers

A:

The child receives approved values without accessing caller-only locals. Initialization fetches the intended source revision with a supported versioning mechanism. Terraform module version metadata differs between registry source addresses and VCS refs.

B:

Clean initialization retrieves the same approved module revision until an explicit upgrade. Initialization fetches the intended source revision with a supported versioning mechanism.

D:

The approved module version downloads for entitled workspaces and unauthorized consumers remain blocked. Initialization fetches the intended source revision with a supported versioning mechanism.

Question 204

At a mobile marketplace operator, a change advisory board is reviewing ML input and inference paths for seller applications and buyer APIs. The reported issue is that a developer logs into HCP Terraform and initializes a root configuration connected to the wrong remote organization or workspace. Confirming evidence shows that cLI run target and backend metadata resolve to a different workspace than the approved deployment request. The recommendation must address the demonstrated ML failure without an unrelated pipeline redesign. Which implementation paired with its verification outcome addresses the same fault?

  1. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access — verify: Remote plans authenticate with short-lived scoped credentials and no personal static secrets
  2. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access — verify: Runs record reviewed module versions and unauthorized consumers cannot pull restricted modules
  3. Configure the appropriate HCP Terraform workspace execution mode and controlled VCS or API runs — verify: Plans and applies appear in the authorized workspace history with required governance checkpoints
  4. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access — verify: A test plan is associated with the authorized HCP workspace and no other workspace state is changed

Explanation

Correct Answer

D:

Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access. A test plan is associated with the authorized HCP workspace and no other workspace state is changed. CLI run target and backend metadata resolve to a different workspace than the approved deployment request. Terraform CLI cloud integration must identify the actual HCP organization and workspace explicitly.

Incorrect Answers

A:

Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access. Remote plans authenticate with short-lived scoped credentials and no personal static secrets. The remedy may be appropriate, but that check does not establish the required recovery. A test plan is associated with the authorized HCP workspace and no other workspace state is changed.

B:

Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access. Runs record reviewed module versions and unauthorized consumers cannot pull restricted modules. The intervention addresses the fault, but the proposed test checks a different outcome. A test plan is associated with the authorized HCP workspace and no other workspace state is changed.

C:

Configure the appropriate HCP Terraform workspace execution mode and controlled VCS or API runs. Plans and applies appear in the authorized workspace history with required governance checkpoints. This pair concerns a different control or outcome, leaving the recorded fault unresolved. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access; A test plan is associated with the authorized HCP workspace and no other workspace state is changed.

Question 205

During an authorized design and operations review at a regional bank technology group, engineers supporting payment and customer network systems discover that an administrator opens terraform.tfstate in an editor to change a remote object ID and a later plan tries to manage a different object. The team proposes to use supported terraform state operations under backup and change control rather than editing raw JSON. The team must preserve approved data handling and avoid widening access to sensitive features. Which post-change observation would establish the required infrastructure or configuration outcome?

  1. State moves or removals follow recorded commands with a recoverable state snapshot
  2. A sanitized debug trace identifies the failed operation and temporary logs are removed under policy
  3. The correct state-mapped provider ID is confirmed without editing raw state files
  4. Terraform state maps the existing database to the intended address and later plans avoid duplicate creation

Explanation

Correct Answer

A:

State moves or removals follow recorded commands with a recoverable state snapshot. State history records an unsupported hand edit and refresh reports the ID does not map to the intended resource. Use supported terraform state operations under backup and change control rather than editing raw JSON.

Incorrect Answers

B:

A sanitized debug trace identifies the failed operation and temporary logs are removed under policy. State history records an unsupported hand edit and refresh reports the ID does not map to the intended resource. State moves or removals follow recorded commands with a recoverable state snapshot.

C:

The correct state-mapped provider ID is confirmed without editing raw state files. State history records an unsupported hand edit and refresh reports the ID does not map to the intended resource. State moves or removals follow recorded commands with a recoverable state snapshot.

D:

Terraform state maps the existing database to the intended address and later plans avoid duplicate creation. State history records an unsupported hand edit and refresh reports the ID does not map to the intended resource. State moves or removals follow recorded commands with a recoverable state snapshot.

Question 206

While protecting seller applications and buyer APIs, the Terraform team at a mobile marketplace operator confirms that an engineer runs terraform import for a module resource before defining the corresponding target block in configuration. Confirming evidence shows that the import operation reports that the specified configuration address cannot be resolved. The recommendation must address the demonstrated ML failure without an unrelated pipeline redesign. Which implementation paired with its verification outcome addresses the same fault?

  1. Declare the expected resource address in the correct module and match the supported import ID form — verify: Terraform state maps the existing database to the intended address and later plans avoid duplicate creation
  2. Declare the expected resource address in the correct module and match the supported import ID form — verify: The existing object is imported into the intended module instance and can be planned safely
  3. Declare the expected resource address in the correct module and match the supported import ID form — verify: New runs use normal logging and incident traces are stored under controlled access
  4. Inspect imported attributes and complete the intended reviewed resource configuration before apply — verify: The first post-import plan is no-op or limited to separately approved changes without deleting the live VM

Explanation

Correct Answer

B:

Declare the expected resource address in the correct module and match the supported import ID form. The existing object is imported into the intended module instance and can be planned safely. An engineer runs terraform import for a module resource before defining the corresponding target block in configuration. Terraform import requires a valid resource address and an identifier understood by the provider.

Incorrect Answers

A:

Declare the expected resource address in the correct module and match the supported import ID form. Terraform state maps the existing database to the intended address and later plans avoid duplicate creation. The intervention addresses the fault, but the proposed test checks a different outcome. The existing object is imported into the intended module instance and can be planned safely.

C:

Declare the expected resource address in the correct module and match the supported import ID form. While protecting seller applications and buyer APIs, new runs use normal logging and incident traces are stored under controlled access. The remedy may be appropriate, but that check does not establish the required recovery. The existing object is imported into the intended module instance and can be planned safely.

D:

Inspect imported attributes and complete the intended reviewed resource configuration before apply. The first post-import plan is no-op or limited to separately approved changes without deleting the live VM. Declare the expected resource address in the correct module and match the supported import ID form; The existing object is imported into the intended module instance and can be planned safely.

Question 207

While protecting research and campus application environments, the Terraform team at a global university IT team confirms that a test cleanup script calls terraform destroy from a terminal whose active backend points at production. The team proposes to confirm backend and workspace identity and require explicit approved targeting before destructive cleanup. Service owners require a reproducible result without unsafe or unapproved production testing. Which post-change observation would establish the required infrastructure or configuration outcome?

  1. Invalid HCL never reaches apply and the corrected configuration passes validation
  2. The next successful apply converges on desired configuration without recreating already tracked objects
  3. The disposable test state is destroyed while production resources remain unchanged
  4. The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run

Explanation

Correct Answer

C:

The disposable test state is destroyed while production resources remain unchanged. Terraform workspace show and backend inspection reveal the production state is selected. Confirm backend and workspace identity and require explicit approved targeting before destructive cleanup.

Incorrect Answers

A:

Invalid HCL never reaches apply and the corrected configuration passes validation. Terraform workspace show and backend inspection reveal the production state is selected. The disposable test state is destroyed while production resources remain unchanged.

B:

The next successful apply converges on desired configuration without recreating already tracked objects. The disposable test state is destroyed while production resources remain unchanged.

D:

The executed artifact hash matches the reviewed plan and unapproved later edits cannot enter the run. Terraform workspace show and backend inspection reveal the production state is selected. The disposable test state is destroyed while production resources remain unchanged.

Question 208

For payment and customer network systems at a regional bank technology group, the infrastructure platform team is investigating the following incident: a configuration requires a community provider but omits its non-HashiCorp source namespace and Terraform searches for the wrong plugin. Confirming evidence shows that terraform init reports that the inferred registry source does not contain the named provider. Service owners require a reproducible result without unsafe or unapproved production testing. Which implementation paired with its verification outcome addresses the same fault?

  1. Set the explicit registry source address within required_providers and verify approved signatures and namespace — verify: Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade
  2. Set the explicit registry source address within required_providers and verify approved signatures and namespace — verify: The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources
  3. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes — verify: Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections
  4. Set the explicit registry source address within required_providers and verify approved signatures and namespace — verify: Initialization installs only the intended reviewed plugin with the correct registry source identity

Explanation

Correct Answer

D:

Set the explicit registry source address within required_providers and verify approved signatures and namespace. Initialization installs only the intended reviewed plugin with the correct registry source identity. Terraform init reports that the inferred registry source does not contain the named provider. Provider source addresses distinguish separate publisher plugins even if local names are similar.

Incorrect Answers

A:

Set the explicit registry source address within required_providers and verify approved signatures and namespace. Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade. That uses the intended change yet measures the wrong result. Initialization installs only the intended reviewed plugin with the correct registry source identity.

B:

Set the explicit registry source address within required_providers and verify approved signatures and namespace. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources. The remedy may be appropriate, but that check does not establish the required recovery. Initialization installs only the intended reviewed plugin with the correct registry source identity.

C:

Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes. Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections. Set the explicit registry source address within required_providers and verify approved signatures and namespace; Initialization installs only the intended reviewed plugin with the correct registry source identity.

Question 209

For airfield and ticketing services at an aviation operations provider, the infrastructure platform team is investigating the following incident: a build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. The team proposes to run terraform init in the correct root module and preserve approved dependency lock metadata. Any change must preserve the approved model contract and show measurable verification evidence. Which post-change observation would establish the required infrastructure or configuration outcome?

  1. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources
  2. Only a single consistent current state snapshot is used for future authorized operations
  3. The module plans against the intended tenant while the first module remains bound to its own provider
  4. Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections

Explanation

Correct Answer

A:

The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources. A build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. Run terraform init in the correct root module and preserve approved dependency lock metadata.

Incorrect Answers

B:

Only a single consistent current state snapshot is used for future authorized operations. A build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources.

C:

The module plans against the intended tenant while the first module remains bound to its own provider. A build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources.

D:

Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources.

Question 210

During an authorized design and operations review at a retail banking integration team, engineers supporting branch and account technology discover that a security module uses a static nested rule block although it receives several approved ingress CIDRs. Observation: plan contains only one nested rule and ignores additional values from the approved input list. The recommendation must address the demonstrated ML failure without an unrelated pipeline redesign. Which intervention most directly addresses the underlying Terraform 1.12 infrastructure workflow failure?

  1. Remove unjustified ignore_changes and make the intended rules explicit, then review the corrective plan
  2. Use a supported dynamic block or for_each expression to generate valid nested configuration elements
  3. Use explicit string keys for the typed map and test required key presence
  4. Add a Terraform variable validation condition for accepted regions and a readable error message

Explanation

Correct Answer

B:

Use a supported dynamic block or for_each expression to generate valid nested configuration elements. Plan contains only one nested rule and ignores additional values from the approved input list. All approved rules appear once in the generated plan without extra open ingress.

Incorrect Answers

A:

Remove unjustified ignore_changes and make the intended rules explicit, then review the corrective plan. Plan contains only one nested rule and ignores additional values from the approved input list. Use a supported dynamic block or for_each expression to generate valid nested configuration elements.

C:

Use explicit string keys for the typed map and test required key presence. Plan contains only one nested rule and ignores additional values from the approved input list. Use a supported dynamic block or for_each expression to generate valid nested configuration elements.

D:

Add a Terraform variable validation condition for accepted regions and a readable error message. Plan contains only one nested rule and ignores additional values from the approved input list. Use a supported dynamic block or for_each expression to generate valid nested configuration elements.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests