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

Question 170

At a food distribution operator, a change advisory board is reviewing ML input and inference paths for warehouse and supply chain services. The reported issue is that a root configuration accepts an unrestricted provider version and a new initialization downloads a release with incompatible resource argument behavior. Observation: lockfile diff and init output identify a new major provider release absent in the last tested run. Service owners require a reproducible result without unsafe or unapproved production testing. Which intervention most directly addresses the underlying Terraform 1.12 infrastructure workflow failure?

  1. Configure the provider's supported authentication through scoped workload identity and check the effective execution principal
  2. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes
  3. Set the explicit registry source address within required_providers and verify approved signatures and namespace
  4. Pass the correct aliased provider explicitly in the module providers mapping and verify module provider requirements

Explanation

Correct Answer

B:

Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes. A root configuration accepts an unrestricted provider version and a new initialization downloads a release with incompatible resource argument behavior. Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections.

Incorrect Answers

A:

Configure the provider's supported authentication through scoped workload identity and check the effective execution principal. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes.

C:

Set the explicit registry source address within required_providers and verify approved signatures and namespace. A root configuration accepts an unrestricted provider version and a new initialization downloads a release with incompatible resource argument behavior. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes.

D:

Pass the correct aliased provider explicitly in the module providers mapping and verify module provider requirements. A root configuration accepts an unrestricted provider version and a new initialization downloads a release with incompatible resource argument behavior. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes.

Question 171

For metering and outage response at an energy infrastructure operator, the infrastructure platform team is investigating the following incident: a child module marks a credential output sensitive but the root module exposes a derived unmarked diagnostic string containing it. Observation: cI logs display a value derived from sensitive content when a root output is printed. 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. Pass the explicit subnet output from the network module into the compute module
  2. Use stable tenant keys with for_each when appropriate and review the state migration
  3. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls
  4. Pin a reviewed module release tag or commit reference and validate compatibility before updating

Explanation

Correct Answer

C:

Keep secret data out of root outputs and enforce sensitive propagation and consumer controls. CI logs display a value derived from sensitive content when a root output is printed. Public output values contain no secret-derived material while approved internal uses remain possible.

Incorrect Answers

A:

Pass the explicit subnet output from the network module into the compute module. CI logs display a value derived from sensitive content when a root output is printed. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls.

B:

Use stable tenant keys with for_each when appropriate and review the state migration. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls.

D:

Pin a reviewed module release tag or commit reference and validate compatibility before updating. CI logs display a value derived from sensitive content when a root output is printed. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls.

Question 172

A controlled cloud model operations assessment for a global university IT team concerns research and campus application environments. Reviewers find that a child module tries to read an input variable that was declared only in the caller and gets an undeclared variable error. The relevant evidence is that validation identifies no variable declaration inside the child despite the parent defining a similarly named value. The plan is to define the child input variable and pass it explicitly in the module block. Which Terraform design principle best explains the chosen response?

  1. Terraform module source syntax and registry access determine how reusable configuration is retrieved
  2. Module source addresses can be versioned or pinned to support repeatable composition
  3. Terraform module version metadata differs between registry source addresses and VCS refs
  4. Each Terraform module has its own variable and local namespace with explicit input boundaries

Explanation

Correct Answer

D:

Each Terraform module has its own variable and local namespace with explicit input boundaries. Validation identifies no variable declaration inside the child despite the parent defining a similarly named value. Define the child input variable and pass it explicitly in the module block.

Incorrect Answers

A:

Terraform module source syntax and registry access determine how reusable configuration is retrieved. Validation identifies no variable declaration inside the child despite the parent defining a similarly named value. Each Terraform module has its own variable and local namespace with explicit input boundaries.

B:

Module source addresses can be versioned or pinned to support repeatable composition. Validation identifies no variable declaration inside the child despite the parent defining a similarly named value. Each Terraform module has its own variable and local namespace with explicit input boundaries.

C:

Terraform module version metadata differs between registry source addresses and VCS refs. Each Terraform module has its own variable and local namespace with explicit input boundaries.

Question 173

A controlled cloud model operations assessment for a mobile marketplace operator concerns seller applications and buyer APIs. Reviewers find that an application pins a module to a permissive version range and a new init selects a release with an incompatible output contract. The relevant evidence is that initialization log shows a new module version and plan errors on a removed output name. The plan is to select a reviewed module version range or exact approved version and test upgrade deliberately. Which Terraform design principle best explains the chosen response?

  1. Registry module versions require deliberate constraints to prevent surprise interface changes
  2. Output interfaces must preserve sensitive-value handling across module boundaries
  3. Stable module instance keys protect resource address continuity as collections change
  4. Module composition uses clearly declared inputs and outputs to connect independently reusable stacks

Explanation

Correct Answer

A:

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

B:

Output interfaces must preserve sensitive-value handling across module boundaries. Registry module versions require deliberate constraints to prevent surprise interface changes.

C:

Stable module instance keys protect resource address continuity as collections change. Registry module versions require deliberate constraints to prevent surprise interface changes.

D:

Module composition uses clearly declared inputs and outputs to connect independently reusable stacks. Registry module versions require deliberate constraints to prevent surprise interface changes.

Question 174

A controlled cloud model operations assessment for a logistics technology company concerns freight scheduling and depot services. Reviewers find that a compute module is reused in a second environment but its required network input is omitted. Observation: validate reports missing module argument even though the underlying network resource exists elsewhere. 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. Select a reviewed module version range or exact approved version and test upgrade deliberately
  2. Pass the explicit subnet output from the network module into the compute module
  3. Pin Git source through a supported ref query or migrate to the registry module syntax
  4. Use the correct module registry source address and configure authorized registry credentials

Explanation

Correct Answer

B:

Pass the explicit subnet output from the network module into the compute module. Validate reports missing module argument even though the underlying network resource exists elsewhere. The compute resource plans against the correct network output and module dependencies are inferred.

Incorrect Answers

A:

Select a reviewed module version range or exact approved version and test upgrade deliberately. Validate reports missing module argument even though the underlying network resource exists elsewhere. Pass the explicit subnet output from the network module into the compute module.

C:

Pin Git source through a supported ref query or migrate to the registry module syntax. Validate reports missing module argument even though the underlying network resource exists elsewhere. Pass the explicit subnet output from the network module into the compute module.

D:

Use the correct module registry source address and configure authorized registry credentials. Validate reports missing module argument even though the underlying network resource exists elsewhere. Pass the explicit subnet output from the network module into the compute module.

Question 175

For research and campus application environments at a global university IT team, the infrastructure platform team is investigating the following incident: a remote HCP Terraform plan is queued from VCS but the provider cannot authenticate even though an engineer's local CLI succeeds. The proposed remedy is to configure approved HCP dynamic provider credentials or secure variable sets for the correct workspace. Only a controlled and reversible ML workflow change fits the approved release window. Which finding would best distinguish the suspected cause from nearby Terraform configuration issues?

  1. HCP workspace team access shows broad permissions that do not match the documented separation of duties
  2. Project and workspace permissions expose production runs to staff outside the responsible team
  3. Run logs show no authorized environment credentials in the workspace execution context
  4. CLI run target and backend metadata resolve to a different workspace than the approved deployment request

Explanation

Correct Answer

C:

Run logs show no authorized environment credentials in the workspace execution context. A remote HCP Terraform plan is queued from VCS but the provider cannot authenticate even though an engineer's local CLI succeeds. Remote plans authenticate with short-lived scoped credentials and no personal static secrets.

Incorrect Answers

A:

HCP workspace team access shows broad permissions that do not match the documented separation of duties. Run logs show no authorized environment credentials in the workspace execution context.

B:

Project and workspace permissions expose production runs to staff outside the responsible team. Run logs show no authorized environment credentials in the workspace execution context.

D:

CLI run target and backend metadata resolve to a different workspace than the approved deployment request. Run logs show no authorized environment credentials in the workspace execution context.

Question 176

At a telecom platform operator, a change advisory board is reviewing ML input and inference paths for subscriber portals and network inventory. The reported issue is that a root configuration accepts an unrestricted provider version and a new initialization downloads a release with incompatible resource argument behavior. Confirming evidence shows that lockfile diff and init output identify a new major provider release absent in the last tested run. Service owners require a reproducible result without unsafe or unapproved production testing. Which implementation paired with its verification outcome addresses the same fault?

  1. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes — verify: Plan can query resources with the intended identity while privileged operations remain limited by policy
  2. Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes — verify: The reviewed plan targets the specified regions independently with the expected credentials
  3. Pass the correct aliased provider explicitly in the module providers mapping and verify module provider requirements — verify: The module plans against the intended tenant while the first module remains bound to its own provider
  4. 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

Explanation

Correct Answer

D:

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. A root configuration accepts an unrestricted provider version and a new initialization downloads a release with incompatible resource argument behavior. Provider version constraints and the lock file work together to stabilize plugin selections.

Incorrect Answers

A:

Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes. Plan can query resources with the intended identity while privileged operations remain limited by policy. The intervention addresses the fault, but the proposed test checks a different outcome. Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections.

B:

Declare an appropriate required_providers source and bounded version constraint and approve dependency-lock changes. The reviewed plan targets the specified regions independently with the expected credentials. That uses the intended change yet measures the wrong result. Clean initialization resolves a tested provider release and repeat runs use consistent dependency selections.

C:

Pass the correct aliased provider explicitly in the module providers mapping and verify module provider requirements. The module plans against the intended tenant while the first module remains bound to its own provider. 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.

Question 177

A controlled cloud model operations assessment for a regional nonprofit network concerns donor operations and learning systems. Reviewers find that a managed service resource contains no direct attribute reference to a security policy required for its bootstrap, so Terraform schedules them concurrently. The proposed remedy is to add a narrow explicit depends_on edge for the real hidden side-effect dependency. 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. Plan graph shows independent operations while startup logs show dependency-related access failures
  2. Input evaluation reports a default variable value and planned network is in the staging CIDR range
  3. Provider returns a successful create while endpoint output points to an unexpected destination
  4. Plan renders an invalid DNS record name even though every individual variable is a string

Explanation

Correct Answer

A:

Plan graph shows independent operations while startup logs show dependency-related access failures. Depends_on expresses relationships not inferable from argument references. The required policy completes before service startup without introducing unnecessary serial dependencies.

Incorrect Answers

B:

A controlled cloud model operations assessment for a regional nonprofit network concerns donor operations and learning systems. Input evaluation reports a default variable value and planned network is in the staging CIDR range. Plan graph shows independent operations while startup logs show dependency-related access failures.

C:

Provider returns a successful create while endpoint output points to an unexpected destination. Plan graph shows independent operations while startup logs show dependency-related access failures.

D:

Plan renders an invalid DNS record name even though every individual variable is a string. Plan graph shows independent operations while startup logs show dependency-related access failures.

Question 178

For freight scheduling and depot services at a logistics technology company, the infrastructure platform team is investigating the following incident: a read-only policy validation job uses terraform fmt without check flags and writes changes to its working tree. Observation: cI reports unexpected modified HCL files after a formatting step. 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 terraform validate for structural checks in addition to terraform fmt for formatting
  2. Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow
  3. Run terraform init within the correct root module before planning, using reviewed backend and plugin settings
  4. Use Terraform reconciliation normally and deliberately request replacement only with an explicit justified workflow

Explanation

Correct Answer

B:

Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow. CI reports unexpected modified HCL files after a formatting step. CI detects formatting deviations without silently modifying committed source.

Incorrect Answers

A:

Use terraform validate for structural checks in addition to terraform fmt for formatting. CI reports unexpected modified HCL files after a formatting step. Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow.

C:

Run terraform init within the correct root module before planning, using reviewed backend and plugin settings. Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow.

D:

Use Terraform reconciliation normally and deliberately request replacement only with an explicit justified workflow. CI reports unexpected modified HCL files after a formatting step. Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow.

Question 179

While protecting airfield and ticketing services, the Terraform team at an aviation operations provider confirms that an engineer sees a state lock error and prepares to force-unlock while another deployment is still applying. Observation: runner audit shows an active workflow and lock ID belonging to the current legitimate writer. 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. Restrict state file permissions and move to an approved secured backend with retention controls
  2. Use moved blocks or deliberate reviewed terraform state mv for address refactoring
  3. Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive
  4. Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage

Explanation

Correct Answer

C:

Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive. An engineer sees a state lock error and prepares to force-unlock while another deployment is still applying. The active apply is not interrupted and stale locks are removed only under a controlled incident record.

Incorrect Answers

A:

Restrict state file permissions and move to an approved secured backend with retention controls. An engineer sees a state lock error and prepares to force-unlock while another deployment is still applying. Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive.

B:

Use moved blocks or deliberate reviewed terraform state mv for address refactoring. An engineer sees a state lock error and prepares to force-unlock while another deployment is still applying. Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive.

D:

Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage. Inspect lock ownership and active runs and only unlock a stale lock after confirming the writer is inactive.

Question 180

A controlled cloud model operations assessment for an aviation operations provider concerns airfield and ticketing services. Reviewers find that a networking module now accepts map(string) subnet CIDRs yet the caller still indexes the input with a numeric position. The relevant evidence is that terraform validation reports an invalid index or wrong type on the planned expression. The plan is to use explicit string keys for the typed map and test required key presence. Which Terraform design principle best explains the chosen response?

  1. depends_on expresses relationships not inferable from argument references
  2. The sensitive mark affects Terraform display behavior and cannot secure every external consumer
  3. Lifecycle ignore_changes can hide drift and should be scoped only to intentionally externally managed fields
  4. Maps are keyed collections while lists are positional sequences in HCL type system

Explanation

Correct Answer

D:

Maps are keyed collections while lists are positional sequences in HCL type system. Terraform validation reports an invalid index or wrong type on the planned expression. Use explicit string keys for the typed map and test required key presence.

Incorrect Answers

A:

Depends_on expresses relationships not inferable from argument references. Terraform validation reports an invalid index or wrong type on the planned expression. Maps are keyed collections while lists are positional sequences in HCL type system.

B:

The sensitive mark affects Terraform display behavior and cannot secure every external consumer. Terraform validation reports an invalid index or wrong type on the planned expression. Maps are keyed collections while lists are positional sequences in HCL type system.

C:

Lifecycle ignore_changes can hide drift and should be scoped only to intentionally externally managed fields. Terraform validation reports an invalid index or wrong type on the planned expression. Maps are keyed collections while lists are positional sequences in HCL type system.

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