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

Question 140

During an authorized design and operations review at a public transit administration, engineers supporting route planning and passenger dashboards discover that a team marks a database password variable sensitive and assumes no secret will be written to Terraform state or saved plans. The team proposes to use supported ephemeral inputs and resource write-only arguments where the provider supports them and secure existing state access. 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. Disallowed region inputs fail early and approved regions proceed through validate and plan
  2. Plan shows the production-approved CIDR and missing required inputs fail before mutation
  3. An unauthorized rule deviation is detected and the approved policy can be reconciled
  4. Supported temporary secret values are omitted from plans and state for the specific write-only path

Explanation

Correct Answer

D:

Supported temporary secret values are omitted from plans and state for the specific write-only path. Sensitive conceals values in UI but only ephemeral and write-only contexts can avoid persistence. Use supported ephemeral inputs and resource write-only arguments where the provider supports them and secure existing state access.

Incorrect Answers

A:

Disallowed region inputs fail early and approved regions proceed through validate and plan. Supported temporary secret values are omitted from plans and state for the specific write-only path.

B:

Plan shows the production-approved CIDR and missing required inputs fail before mutation. Supported temporary secret values are omitted from plans and state for the specific write-only path. Sensitive conceals values in UI but only ephemeral and write-only contexts can avoid persistence.

C:

An unauthorized rule deviation is detected and the approved policy can be reconciled. Supported temporary secret values are omitted from plans and state for the specific write-only path.

Question 141

While protecting route planning and passenger dashboards, the Terraform team at a public transit administration confirms that a CI pipeline deletes .terraform.lock.hcl on each run and a previously tested provider unexpectedly changes during redeployment. Confirming evidence shows that build logs show provider selection repeated without the committed checksums and versions. 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. Commit and retain the dependency lock file and initialize without unreviewed provider upgrades — verify: Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade
  2. Commit and retain the dependency lock file and initialize without unreviewed provider upgrades — verify: A subsequent plan recognizes the existing object under the new address without replacing it
  3. Commit and retain the dependency lock file and initialize without unreviewed provider upgrades — verify: Initialization installs only the intended reviewed plugin with the correct registry source identity
  4. Configure an aliased provider instance and attach the intended provider alias to the second resource — verify: The reviewed plan targets the specified regions independently with the expected credentials

Explanation

Correct Answer

A:

Commit and retain the dependency lock file and initialize without unreviewed provider upgrades. Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade. Build logs show provider selection repeated without the committed checksums and versions. The lockfile records selected providers and integrity checks for reproducible initialization.

Incorrect Answers

B:

Commit and retain the dependency lock file and initialize without unreviewed provider upgrades. A subsequent plan recognizes the existing object under the new address without replacing it. The intervention addresses the fault, but the proposed test checks a different outcome. Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade.

C:

Commit and retain the dependency lock file and initialize without unreviewed provider upgrades. Initialization installs only the intended reviewed plugin with the correct registry source identity. That uses the intended change yet measures the wrong result. Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade.

D:

Configure an aliased provider instance and attach the intended provider alias to the second resource. The reviewed plan targets the specified regions independently with the expected credentials. Commit and retain the dependency lock file and initialize without unreviewed provider upgrades; Multiple clean builds use the same selected provider versions until an explicitly reviewed upgrade.

Question 142

At a geospatial analytics startup, a change advisory board is reviewing ML input and inference paths for satellite data ingest and model systems. The reported issue is that an HCP Terraform organization groups production finance workspaces with general shared testing projects and inherits broad team access. The proposed remedy is to organize workspaces into appropriate HCP projects and assign scoped project and workspace team access. 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 is initially empty while a local state file already tracks live resources
  2. Project and workspace permissions expose production runs to staff outside the responsible team
  3. CLI run target and backend metadata resolve to a different workspace than the approved deployment request
  4. HCP run history lacks approved changes while cloud audit records show workstation-origin operations

Explanation

Correct Answer

B:

Project and workspace permissions expose production runs to staff outside the responsible team. At a geospatial analytics startup, an HCP Terraform organization groups production finance workspaces with general shared testing projects and inherits broad team access. Organize workspaces into appropriate HCP projects and assign scoped project and workspace team access.

Incorrect Answers

A:

HCP workspace is initially empty while a local state file already tracks live resources. At a geospatial analytics startup, project and workspace permissions expose production runs to staff outside the responsible team. Organize workspaces into appropriate HCP projects and assign scoped project and workspace team access.

C:

CLI run target and backend metadata resolve to a different workspace than the approved deployment request. Organize workspaces into appropriate HCP projects and assign scoped project and workspace team access.

D:

HCP run history lacks approved changes while cloud audit records show workstation-origin operations. Project and workspace permissions expose production runs to staff outside the responsible team. Organize workspaces into appropriate HCP projects and assign scoped project and workspace team access.

Question 143

During an authorized design and operations review at a public transit administration, engineers supporting route planning and passenger dashboards discover that a branch passes terraform fmt but contains an invalid reference to a nonexistent module output. The relevant evidence is that the file layout is formatted yet terraform validate reports an undeclared reference. The plan is to use terraform validate for structural checks in addition to terraform fmt for formatting. Which Terraform design principle best explains the chosen response?

  1. The core Terraform workflow separates configuration intent and reviewed execution from actual infrastructure mutation
  2. Terraform validation tests configuration correctness separately from creating a cloud execution plan
  3. Formatting adjusts source layout but does not prove configuration references or expressions are valid
  4. Backend changes require deliberate reinitialization and sometimes state migration rather than blind planning

Explanation

Correct Answer

C:

Formatting adjusts source layout but does not prove configuration references or expressions are valid. Use terraform validate for structural checks in addition to terraform fmt for formatting.

Incorrect Answers

A:

The core Terraform workflow separates configuration intent and reviewed execution from actual infrastructure mutation. Formatting adjusts source layout but does not prove configuration references or expressions are valid.

B:

Terraform validation tests configuration correctness separately from creating a cloud execution plan. Formatting adjusts source layout but does not prove configuration references or expressions are valid.

D:

Backend changes require deliberate reinitialization and sometimes state migration rather than blind planning. Formatting adjusts source layout but does not prove configuration references or expressions are valid.

Question 144

During an authorized design and operations review at a telecom platform operator, engineers supporting subscriber portals and network inventory discover that a module declaration adds version=1.2.0 while its source is a Git URL rather than a registry address. Observation: initialization reports unsupported version argument for a nonregistry module source. 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. Pass the explicit subnet output from the network module into the compute module
  2. Keep secret data out of root outputs and enforce sensitive propagation and consumer controls
  3. Pin a reviewed module release tag or commit reference and validate compatibility before updating
  4. Pin Git source through a supported ref query or migrate to the registry module syntax

Explanation

Correct Answer

D:

Pin Git source through a supported ref query or migrate to the registry module syntax. During an authorized design and operations review at a telecom platform operator, initialization reports unsupported version argument for a nonregistry module source. Initialization fetches the intended source revision with a supported versioning mechanism.

Incorrect Answers

A:

Pass the explicit subnet output from the network module into the compute module. During an authorized design and operations review at a telecom platform operator, initialization reports unsupported version argument for a nonregistry module source. Pin Git source through a supported ref query or migrate to the registry module syntax.

B:

Keep secret data out of root outputs and enforce sensitive propagation and consumer controls. During an authorized design and operations review at a telecom platform operator, initialization reports unsupported version argument for a nonregistry module source. Pin Git source through a supported ref query or migrate to the registry module syntax.

C:

Pin a reviewed module release tag or commit reference and validate compatibility before updating. Initialization reports unsupported version argument for a nonregistry module source. Pin Git source through a supported ref query or migrate to the registry module syntax.

Question 145

For freight scheduling and depot services at a logistics technology company, the infrastructure platform team is investigating the following incident: a compute module is reused in a second environment but its required network input is omitted. The proposed remedy is to pass the explicit subnet output from the network module into the compute module. 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. Validate reports missing module argument even though the underlying network resource exists elsewhere
  2. Validation identifies no variable declaration inside the child despite the parent defining a similarly named value
  3. CI logs display a value derived from sensitive content when a root output is printed
  4. Initialization log shows a new module version and plan errors on a removed output name

Explanation

Correct Answer

A:

Validate reports missing module argument even though the underlying network resource exists elsewhere. A compute module is reused in a second environment but its required network input is omitted. The compute resource plans against the correct network output and module dependencies are inferred.

Incorrect Answers

B:

Validation identifies no variable declaration inside the child despite the parent defining a similarly named value. Validate reports missing module argument even though the underlying network resource exists elsewhere.

C:

CI logs display a value derived from sensitive content when a root output is printed. Validate reports missing module argument even though the underlying network resource exists elsewhere.

D:

Initialization log shows a new module version and plan errors on a removed output name. Validate reports missing module argument even though the underlying network resource exists elsewhere.

Question 146

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 after a cloud VM is imported a minimal resource block omits important existing immutable settings and the first plan shows replacement. The team proposes to inspect imported attributes and complete the intended reviewed resource configuration before apply. 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. State moves or removals follow recorded commands with a recoverable state snapshot
  2. The first post-import plan is no-op or limited to separately approved changes without deleting the live VM
  3. Terraform state maps the existing database to the intended address and later plans avoid duplicate creation
  4. New runs use normal logging and incident traces are stored under controlled access

Explanation

Correct Answer

B:

The first post-import plan is no-op or limited to separately approved changes without deleting the live VM. After a cloud VM is imported a minimal resource block omits important existing immutable settings and the first plan shows replacement. Inspect imported attributes and complete the intended reviewed resource configuration before apply.

Incorrect Answers

A:

State moves or removals follow recorded commands with a recoverable state snapshot. The first post-import plan is no-op or limited to separately approved changes without deleting the live VM.

C:

Terraform state maps the existing database to the intended address and later plans avoid duplicate creation. After a cloud VM is imported a minimal resource block omits important existing immutable settings and the first plan shows replacement. The first post-import plan is no-op or limited to separately approved changes without deleting the live VM.

D:

New runs use normal logging and incident traces are stored under controlled access. After a cloud VM is imported a minimal resource block omits important existing immutable settings and the first plan shows replacement. The first post-import plan is no-op or limited to separately approved changes without deleting the live VM.

Question 147

While protecting analytics and private data feeds, the Terraform team at a market data company confirms that an application resource uses a manually copied subnet ID and deploys against the wrong network after an environment rebuild. The proposed remedy is to reference the managed subnet attribute and let Terraform infer the dependency. 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. Plan shows deletion of the only active endpoint before a replacement is provisioned
  2. CI log includes a secret value even though Terraform UI redacted the sensitive output earlier
  3. Terraform references show a literal subnet ID rather than the subnet resource attribute from the same configuration
  4. Source scanning finds a reusable token committed with Terraform configuration

Explanation

Correct Answer

C:

Terraform references show a literal subnet ID rather than the subnet resource attribute from the same configuration. An application resource uses a manually copied subnet ID and deploys against the wrong network after an environment rebuild. Reference the managed subnet attribute and let Terraform infer the dependency.

Incorrect Answers

A:

Plan shows deletion of the only active endpoint before a replacement is provisioned. Terraform references show a literal subnet ID rather than the subnet resource attribute from the same configuration. Reference the managed subnet attribute and let Terraform infer the dependency.

B:

CI log includes a secret value even though Terraform UI redacted the sensitive output earlier. Reference the managed subnet attribute and let Terraform infer the dependency.

D:

Source scanning finds a reusable token committed with Terraform configuration. Terraform references show a literal subnet ID rather than the subnet resource attribute from the same configuration. Reference the managed subnet attribute and let Terraform infer the dependency.

Question 148

While protecting freight scheduling and depot services, the Terraform team at a logistics technology company confirms that two engineers copy a local state file into separate machines and independently apply changes to the same resource set. Confirming evidence shows that both state snapshots contain different serials and each claims authority over the same infrastructure objects. Service owners require a reproducible result without unsafe or unapproved production testing. Which implementation paired with its verification outcome addresses the same fault?

  1. Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies — verify: The reviewed plan targets the specified regions independently with the expected credentials
  2. Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies — verify: The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources
  3. Configure the provider's supported authentication through scoped workload identity and check the effective execution principal — verify: Plan can query resources with the intended identity while privileged operations remain limited by policy
  4. Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies — verify: Only a single consistent current state snapshot is used for future authorized operations

Explanation

Correct Answer

D:

Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies. Only a single consistent current state snapshot is used for future authorized operations. Both state snapshots contain different serials and each claims authority over the same infrastructure objects. Terraform state requires a consistent ownership map so concurrent writers do not make conflicting assumptions.

Incorrect Answers

A:

Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies. The reviewed plan targets the specified regions independently with the expected credentials. That uses the intended change yet measures the wrong result. Only a single consistent current state snapshot is used for future authorized operations.

B:

Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies. 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. Only a single consistent current state snapshot is used for future authorized operations.

C:

Configure the provider's supported authentication through scoped workload identity and check the effective execution principal. Plan can query resources with the intended identity while privileged operations remain limited by policy. Choose a controlled shared backend with state locking and reconcile the current authoritative state before further applies; Only a single consistent current state snapshot is used for future authorized operations.

Question 149

During an authorized design and operations review at a manufacturing supply-chain platform, engineers supporting vendor ordering and inventory APIs discover that an apply fails intermittently with an opaque provider error and the default console output cannot distinguish token failure from timeout. The team proposes to enable supported TF_LOG level and TF_LOG_PATH for a controlled repro with secret-safe handling. 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. A sanitized debug trace identifies the failed operation and temporary logs are removed under policy
  2. New runs use normal logging and incident traces are stored under controlled access
  3. The correct state-mapped provider ID is confirmed without editing raw state files
  4. State moves or removals follow recorded commands with a recoverable state snapshot

Explanation

Correct Answer

A:

A sanitized debug trace identifies the failed operation and temporary logs are removed under policy. Terraform verbose logging can expose sensitive details and should be scoped to incident diagnosis. Enable supported TF_LOG level and TF_LOG_PATH for a controlled repro with secret-safe handling.

Incorrect Answers

B:

New runs use normal logging and incident traces are stored under controlled access. A sanitized debug trace identifies the failed operation and temporary logs are removed under policy.

C:

The correct state-mapped provider ID is confirmed without editing raw state files. A sanitized debug trace identifies the failed operation and temporary logs are removed under policy. Terraform verbose logging can expose sensitive details and should be scoped to incident diagnosis.

D:

State moves or removals follow recorded commands with a recoverable state snapshot. A sanitized debug trace identifies the failed operation and temporary logs are removed under policy.

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.

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