HashiCorp Terraform Associate 004 Practice Test 16 - 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 16

Question 150

For branch and account technology at a retail banking integration team, the infrastructure platform team is investigating the following incident: two workspaces configure a remote object-store backend with the same state path key for unrelated environments. The proposed remedy is to assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity. Any change must preserve the approved model contract and show measurable verification evidence. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?

  1. Backend folder has no state history while a local terraform.tfstate still maps production resources
  2. Plan for staging shows destructive changes on production resource IDs
  3. Removing the resource block from configuration causes plan to schedule DNS record deletion
  4. Runner audit shows an active workflow and lock ID belonging to the current legitimate writer

Explanation

Correct Answer

B:

Plan for staging shows destructive changes on production resource IDs. Two workspaces configure a remote object-store backend with the same state path key for unrelated environments. Each environment plan shows only its own managed objects and account resources.

Incorrect Answers

A:

Backend folder has no state history while a local terraform.tfstate still maps production resources. Plan for staging shows destructive changes on production resource IDs.

C:

Removing the resource block from configuration causes plan to schedule DNS record deletion. Plan for staging shows destructive changes on production resource IDs.

D:

Runner audit shows an active workflow and lock ID belonging to the current legitimate writer. Plan for staging shows destructive changes on production resource IDs.

Question 151

While protecting flight and hotel reservation services, the Terraform team at a global booking platform confirms that a CI job uses the default local backend and loses its terraform.tfstate file after a successful apply. The relevant evidence is that a later job sees no prior state and proposes to create every existing remote object again. The plan is to migrate to an approved durable shared backend before repeating managed applies. Which Terraform design principle best explains the chosen response?

  1. Terraform compares desired configuration with refreshed remote objects and recorded state to detect drift
  2. Remote backend isolation depends on explicit workspace or state-key identity not merely folder names
  3. The local backend stores state on the executing filesystem and is unsuitable when that filesystem is disposable
  4. Force-unlock is a recovery operation that can endanger state when used against a live writer

Explanation

Correct Answer

C:

The local backend stores state on the executing filesystem and is unsuitable when that filesystem is disposable. A later job sees no prior state and proposes to create every existing remote object again. Migrate to an approved durable shared backend before repeating managed applies.

Incorrect Answers

A:

Terraform compares desired configuration with refreshed remote objects and recorded state to detect drift. A later job sees no prior state and proposes to create every existing remote object again. The local backend stores state on the executing filesystem and is unsuitable when that filesystem is disposable.

B:

Remote backend isolation depends on explicit workspace or state-key identity not merely folder names. A later job sees no prior state and proposes to create every existing remote object again. The local backend stores state on the executing filesystem and is unsuitable when that filesystem is disposable.

D:

Force-unlock is a recovery operation that can endanger state when used against a live writer. A later job sees no prior state and proposes to create every existing remote object again. The local backend stores state on the executing filesystem and is unsuitable when that filesystem is disposable.

Question 152

While protecting metering and outage response, the Terraform team at an energy infrastructure operator confirms that a child module marks a credential output sensitive but the root module exposes a derived unmarked diagnostic string containing it. The relevant evidence is that cI logs display a value derived from sensitive content when a root output is printed. The plan is to keep secret data out of root outputs and enforce sensitive propagation and consumer controls. Which Terraform design principle best explains the chosen response?

  1. Stable module instance keys protect resource address continuity as collections change
  2. Terraform module version metadata differs between registry source addresses and VCS refs
  3. Module composition uses clearly declared inputs and outputs to connect independently reusable stacks
  4. Output interfaces must preserve sensitive-value handling across module boundaries

Explanation

Correct Answer

D:

Output interfaces must preserve sensitive-value handling across module boundaries. A child module marks a credential output sensitive but the root module exposes a derived unmarked diagnostic string containing it. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls.

Incorrect Answers

A:

Stable module instance keys protect resource address continuity as collections change. Output interfaces must preserve sensitive-value handling across module boundaries.

B:

Terraform module version metadata differs between registry source addresses and VCS refs. A child module marks a credential output sensitive but the root module exposes a derived unmarked diagnostic string containing it. Output interfaces must preserve sensitive-value handling across module boundaries.

C:

Module composition uses clearly declared inputs and outputs to connect independently reusable stacks. A child module marks a credential output sensitive but the root module exposes a derived unmarked diagnostic string containing it. Output interfaces must preserve sensitive-value handling across module boundaries.

Question 153

A controlled cloud model operations assessment for a water utility engineering division concerns field diagnostics and public service. Reviewers find that multiple collaborators can approve and apply all production runs despite policy requiring separate review and apply roles. The relevant evidence is that hCP workspace team access shows broad permissions that do not match the documented separation of duties. The plan is to configure workspace teams and protected approval or policy checks in the appropriate HCP plan. Which Terraform design principle best explains the chosen response?

  1. HCP Terraform collaboration features can enforce role-based changes and governance workflows
  2. HCP Terraform projects help organize workspaces and access boundaries but are not themselves Terraform state files
  3. Terraform CLI cloud integration must identify the actual HCP organization and workspace explicitly
  4. HCP Terraform can centrally coordinate Terraform execution when workspace settings and permissions are configured

Explanation

Correct Answer

A:

HCP Terraform collaboration features can enforce role-based changes and governance workflows. HCP workspace team access shows broad permissions that do not match the documented separation of duties. Configure workspace teams and protected approval or policy checks in the appropriate HCP plan.

Incorrect Answers

B:

HCP Terraform projects help organize workspaces and access boundaries but are not themselves Terraform state files. HCP Terraform collaboration features can enforce role-based changes and governance workflows.

C:

Terraform CLI cloud integration must identify the actual HCP organization and workspace explicitly. HCP workspace team access shows broad permissions that do not match the documented separation of duties. HCP Terraform collaboration features can enforce role-based changes and governance workflows.

D:

HCP Terraform can centrally coordinate Terraform execution when workspace settings and permissions are configured. HCP workspace team access shows broad permissions that do not match the documented separation of duties. HCP Terraform collaboration features can enforce role-based changes and governance workflows.

Question 154

At a healthcare software provider, a change advisory board is reviewing ML input and inference paths for regulated clinical workflow infrastructure. The reported issue is that an organization adopts Terraform for a long-running database but a new resource block would attempt to create a duplicate instance. The relevant evidence is that plan shows a second resource with the same requested name even though a production DB already exists. The plan is to declare a matching resource and use supported import block or terraform import to adopt the existing remote ID. Which Terraform design principle best explains the chosen response?

  1. The state CLI separates address discovery from attribute inspection
  2. Import adds an existing object to Terraform resource state rather than creating it
  3. Terraform state commands protect address and identity bookkeeping better than manual file edits
  4. Importing state does not automatically guarantee a complete or correct desired resource configuration

Explanation

Correct Answer

B:

Import adds an existing object to Terraform resource state rather than creating it. Plan shows a second resource with the same requested name even though a production DB already exists. Declare a matching resource and use supported import block or terraform import to adopt the existing remote ID.

Incorrect Answers

A:

The state CLI separates address discovery from attribute inspection. Plan shows a second resource with the same requested name even though a production DB already exists. Import adds an existing object to Terraform resource state rather than creating it.

C:

Terraform state commands protect address and identity bookkeeping better than manual file edits. Import adds an existing object to Terraform resource state rather than creating it.

D:

Importing state does not automatically guarantee a complete or correct desired resource configuration. Plan shows a second resource with the same requested name even though a production DB already exists. Import adds an existing object to Terraform resource state rather than creating it.

Question 155

During an authorized design and operations review at a market data company, engineers supporting analytics and private data feeds discover that an application pins a module to a permissive version range and a new init selects a release with an incompatible output contract. The team proposes to select a reviewed module version range or exact approved version and test upgrade deliberately. 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. The approved module version downloads for entitled workspaces and unauthorized consumers remain blocked
  2. The child receives approved values without accessing caller-only locals
  3. The same source resolves to the reviewed module interface across clean deployments
  4. The compute resource plans against the correct network output and module dependencies are inferred

Explanation

Correct Answer

C:

The same source resolves to the reviewed module interface across clean deployments. Registry module versions require deliberate constraints to prevent surprise interface changes. Select a reviewed module version range or exact approved version and test upgrade deliberately.

Incorrect Answers

A:

The approved module version downloads for entitled workspaces and unauthorized consumers remain blocked. The same source resolves to the reviewed module interface across clean deployments. Registry module versions require deliberate constraints to prevent surprise interface changes.

B:

The child receives approved values without accessing caller-only locals. The same source resolves to the reviewed module interface across clean deployments.

D:

The compute resource plans against the correct network output and module dependencies are inferred. The same source resolves to the reviewed module interface across clean deployments.

Question 156

While protecting research and campus application environments, the Terraform team at a global university IT team confirms that a build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. The proposed remedy is to run terraform init in the correct root module and preserve approved dependency lock metadata. The recommendation must address the demonstrated ML failure without an unrelated pipeline redesign. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?

  1. The plan identifies both resources under the same provider configuration even though one should use a regional alias
  2. Lockfile diff and init output identify a new major provider release absent in the last tested run
  3. Build logs show provider selection repeated without the committed checksums and versions
  4. The working directory has no downloaded plugin and init has not been executed for the current configuration

Explanation

Correct Answer

D:

The working directory has no downloaded plugin and init has not been executed for the current configuration. 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

A:

The plan identifies both resources under the same provider configuration even though one should use a regional alias. The working directory has no downloaded plugin and init has not been executed for the current configuration. Run terraform init in the correct root module and preserve approved dependency lock metadata.

B:

Lockfile diff and init output identify a new major provider release absent in the last tested run. The working directory has no downloaded plugin and init has not been executed for the current configuration. Run terraform init in the correct root module and preserve approved dependency lock metadata.

C:

Build logs show provider selection repeated without the committed checksums and versions. The working directory has no downloaded plugin and init has not been executed for the current configuration. Run terraform init in the correct root module and preserve approved dependency lock metadata.

Question 157

While protecting tenant onboarding and document workflows, the Terraform team at a multi-tenant SaaS vendor confirms that a workspace references a private organization module as though it were a public registry module and initialization fails to authenticate. Observation: terraform init reports module registry not found or missing entitlement for the expected organization. The team must preserve approved data handling and avoid widening access to sensitive features. Which intervention most directly addresses the underlying Terraform 1.12 infrastructure workflow failure?

  1. Use the correct module registry source address and configure authorized registry credentials
  2. Expose a minimal root-level mapping and pass the needed value explicitly into the other module
  3. Define the child input variable and pass it explicitly in the module block
  4. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls

Explanation

Correct Answer

A:

Use the correct module registry source address and configure authorized registry credentials. Terraform init reports module registry not found or missing entitlement for the expected organization. The approved module version downloads for entitled workspaces and unauthorized consumers remain blocked.

Incorrect Answers

B:

Expose a minimal root-level mapping and pass the needed value explicitly into the other module. Terraform init reports module registry not found or missing entitlement for the expected organization. Use the correct module registry source address and configure authorized registry credentials.

C:

Define the child input variable and pass it explicitly in the module block. Terraform init reports module registry not found or missing entitlement for the expected organization. Use the correct module registry source address and configure authorized registry credentials.

D:

Keep secret data out of root outputs and enforce sensitive propagation and consumer controls. Terraform init reports module registry not found or missing entitlement for the expected organization. Use the correct module registry source address and configure authorized registry credentials.

Question 158

At a retail banking integration team, a change advisory board is reviewing ML input and inference paths for branch and account technology. The reported issue is that an operations team maintains a spreadsheet of compute hosts while several untracked production resources continue charging and lack ownership. Observation: cloud inventory differs from recorded spreadsheet assets and no repeatable source identifies the missing resources. Only a controlled and reversible ML workflow change fits the approved release window. Which intervention most directly addresses the underlying Terraform 1.12 infrastructure workflow failure?

  1. Require versioned Terraform changes and reviewed speculative plans before approved apply while limiting direct production mutation
  2. Bring managed resources under a controlled declarative workflow after inventory and import review while retaining documented ownership
  3. Define reviewed version-controlled Terraform resource declarations for the target infrastructure and use plan then apply through authorized delivery
  4. Model common infrastructure through reusable Terraform configuration and explicit environment inputs instead of copying mutable scripts

Explanation

Correct Answer

B:

Bring managed resources under a controlled declarative workflow after inventory and import review while retaining documented ownership. An operations team maintains a spreadsheet of compute hosts while several untracked production resources continue charging and lack ownership. Terraform configuration and state map the agreed resources and controlled plans reveal subsequent differences.

Incorrect Answers

A:

Require versioned Terraform changes and reviewed speculative plans before approved apply while limiting direct production mutation. Bring managed resources under a controlled declarative workflow after inventory and import review while retaining documented ownership.

C:

Define reviewed version-controlled Terraform resource declarations for the target infrastructure and use plan then apply through authorized delivery. An operations team maintains a spreadsheet of compute hosts while several untracked production resources continue charging and lack ownership. Bring managed resources under a controlled declarative workflow after inventory and import review while retaining documented ownership.

D:

Model common infrastructure through reusable Terraform configuration and explicit environment inputs instead of copying mutable scripts. An operations team maintains a spreadsheet of compute hosts while several untracked production resources continue charging and lack ownership. Bring managed resources under a controlled declarative workflow after inventory and import review while retaining documented ownership.

Question 159

At a global university IT team, a change advisory board is reviewing ML input and inference paths for research and campus application environments. The reported issue is that a test cleanup script calls terraform destroy from a terminal whose active backend points at production. The proposed remedy is to confirm backend and workspace identity and require explicit approved targeting before destructive cleanup. The team must preserve approved data handling and avoid widening access to sensitive features. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?

  1. Code review diffs contain indentation churn even when blocks have identical meaning
  2. The file layout is formatted yet terraform validate reports an undeclared reference
  3. terraform workspace show and backend inspection reveal the production state is selected
  4. Pipeline history contains no saved or reviewed plan and the apply output shows a surprise destructive action

Explanation

Correct Answer

C:

Terraform workspace show and backend inspection reveal the production state is selected. At a global university IT team, a test cleanup script calls terraform destroy from a terminal whose active backend points at production. Confirm backend and workspace identity and require explicit approved targeting before destructive cleanup.

Incorrect Answers

A:

Code review diffs contain indentation churn even when blocks have identical meaning. 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.

B:

The file layout is formatted yet terraform validate reports an undeclared reference. Confirm backend and workspace identity and require explicit approved targeting before destructive cleanup.

D:

Pipeline history contains no saved or reviewed plan and the apply output shows a surprise destructive action. 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.

Question 160

A controlled cloud model operations assessment for a mobile marketplace operator concerns seller applications and buyer APIs. Reviewers find that a project changes its backend address but a local checkout still uses previously cached backend initialization metadata. Confirming evidence shows that plan warns that backend configuration changed and requests reinitialization or migration review. Service owners require a reproducible result without unsafe or unapproved production testing. Which implementation paired with its verification outcome addresses the same fault?

  1. Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure — verify: A no-change plan remains non-mutating while approved replacements are separately auditable
  2. Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure — verify: The configuration is both consistently formatted and structurally valid before planning
  3. Implement the standard write-initialize-plan-review-apply lifecycle with required approval before mutation — verify: Every deployment has an inspected change proposal and the approved apply uses the reviewed scope
  4. Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure — verify: The local working directory points at the approved backend and existing state has been accounted for

Explanation

Correct Answer

D:

Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure. The local working directory points at the approved backend and existing state has been accounted for. Plan warns that backend configuration changed and requests reinitialization or migration review. Backend changes require deliberate reinitialization and sometimes state migration rather than blind planning.

Incorrect Answers

A:

Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure. A no-change plan remains non-mutating while approved replacements are separately auditable. That uses the intended change yet measures the wrong result. The local working directory points at the approved backend and existing state has been accounted for.

B:

Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure. The configuration is both consistently formatted and structurally valid before planning. The remedy may be appropriate, but that check does not establish the required recovery. The local working directory points at the approved backend and existing state has been accounted for.

C:

Implement the standard write-initialize-plan-review-apply lifecycle with required approval before mutation. Every deployment has an inspected change proposal and the approved apply uses the reviewed scope. Review desired state migration and rerun terraform init with the appropriate reconfigure or migrate-state procedure; The local working directory points at the approved backend and existing state has been accounted for.

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