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

Question 40

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. Confirming evidence shows that plan for staging shows destructive changes on production resource IDs. Any change must preserve the approved model contract and show measurable verification evidence. Which implementation paired with its verification outcome addresses the same fault?

  1. Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity — verify: The resource maps to its new address without recreating or reimporting the remote object
  2. Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity — verify: A second writer waits or fails safely while a first authorized apply holds the lock
  3. 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
  4. Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity — verify: Each environment plan shows only its own managed objects and account resources

Explanation

Correct Answer

D:

Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity. Each environment plan shows only its own managed objects and account resources. Plan for staging shows destructive changes on production resource IDs. Remote backend isolation depends on explicit workspace or state-key identity not merely folder names.

Incorrect Answers

A:

Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity. The resource maps to its new address without recreating or reimporting the remote object. That uses the intended change yet measures the wrong result. Each environment plan shows only its own managed objects and account resources.

B:

Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity. A second writer waits or fails safely while a first authorized apply holds the lock. The remedy may be appropriate, but that check does not establish the required recovery. Each environment plan shows only its own managed objects and account resources.

C:

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. Assign independent state keys or workspaces with strict access boundaries and verify their actual remote state identity; Each environment plan shows only its own managed objects and account resources.

Question 41

During an authorized design and operations review at an energy infrastructure operator, engineers supporting metering and outage response discover that a shared module repository accumulates inconsistent alignment and spacing changes that obscure meaningful resource edits. The relevant evidence is that code review diffs contain indentation churn even when blocks have identical meaning. The plan is to run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes. Which Terraform design principle best explains the chosen response?

  1. Terraform fmt normalizes configuration formatting and should be distinguished from plan or apply
  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. Terraform apply converges managed resources toward desired state rather than reconstructing everything each run

Explanation

Correct Answer

A:

Terraform fmt normalizes configuration formatting and should be distinguished from plan or apply. Run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes.

Incorrect Answers

B:

Terraform validation tests configuration correctness separately from creating a cloud execution plan. Terraform fmt normalizes configuration formatting and should be distinguished from plan or apply.

C:

Formatting adjusts source layout but does not prove configuration references or expressions are valid. Terraform fmt normalizes configuration formatting and should be distinguished from plan or apply.

D:

Terraform apply converges managed resources toward desired state rather than reconstructing everything each run. Terraform fmt normalizes configuration formatting and should be distinguished from plan or apply.

Question 42

For vendor ordering and inventory APIs at a manufacturing supply-chain platform, the infrastructure platform team is investigating the following incident: a deployment defines two regions with one default provider and accidentally creates both resource groups in the primary region. The team proposes to configure an aliased provider instance and attach the intended provider alias to the second resource. 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. A subsequent plan recognizes the existing object under the new address without replacing it
  2. The reviewed plan targets the specified regions independently with the expected credentials
  3. Plan can query resources with the intended identity while privileged operations remain limited by policy
  4. The module plans against the intended tenant while the first module remains bound to its own provider

Explanation

Correct Answer

B:

The reviewed plan targets the specified regions independently with the expected credentials. The plan identifies both resources under the same provider configuration even though one should use a regional alias. Configure an aliased provider instance and attach the intended provider alias to the second resource.

Incorrect Answers

A:

A subsequent plan recognizes the existing object under the new address without replacing it. The plan identifies both resources under the same provider configuration even though one should use a regional alias. The reviewed plan targets the specified regions independently with the expected credentials.

C:

Plan can query resources with the intended identity while privileged operations remain limited by policy. The plan identifies both resources under the same provider configuration even though one should use a regional alias. The reviewed plan targets the specified regions independently with the expected credentials.

D:

The module plans against the intended tenant while the first module remains bound to its own provider. The plan identifies both resources under the same provider configuration even though one should use a regional alias. The reviewed plan targets the specified regions independently with the expected credentials.

Question 43

A controlled cloud model operations assessment for a market data company concerns analytics and private data feeds. Reviewers find 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 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. Declare the expected resource address in the correct module and match the supported import ID form — verify: The correct state-mapped provider ID is confirmed without editing raw state files
  2. 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
  3. 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
  4. Use supported terraform state operations under backup and change control rather than editing raw JSON — verify: State moves or removals follow recorded commands with a recoverable state snapshot

Explanation

Correct Answer

C:

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. The import operation reports that the specified configuration address cannot be resolved. 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. The correct state-mapped provider ID is confirmed without editing raw state files. That uses the intended change yet measures the wrong result. The existing object is imported into the intended module instance and can be planned safely.

B:

Declare the expected resource address in the correct module and match the supported import ID form. 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:

Use supported terraform state operations under backup and change control rather than editing raw JSON. State moves or removals follow recorded commands with a recoverable state snapshot. This pair concerns a different control or outcome, leaving the recorded fault unresolved. 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 44

At a manufacturing supply-chain platform, a change advisory board is reviewing ML input and inference paths for vendor ordering and inventory APIs. The reported issue is that a team writes a remote backend block and assumes its old local state will migrate automatically without an initialization decision. Observation: backend folder has no state history while a local terraform.tfstate still maps production resources. 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. Review drift evidence and decide whether to restore declared state or adopt an approved new configuration
  2. Restrict state file permissions and move to an approved secured backend with retention controls
  3. Use a supported removed block with destroy=false or controlled state rm after confirming handover
  4. Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage

Explanation

Correct Answer

D:

Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage. A team writes a remote backend block and assumes its old local state will migrate automatically without an initialization decision. Authorized workspace reads the original managed identities from the remote backend and local copies are controlled.

Incorrect Answers

A:

Review drift evidence and decide whether to restore declared state or adopt an approved new configuration. Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage.

B:

Restrict state file permissions and move to an approved secured backend with retention controls. A team writes a remote backend block and assumes its old local state will migrate automatically without an initialization decision. Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage.

C:

Use a supported removed block with destroy=false or controlled state rm after confirming handover. A team writes a remote backend block and assumes its old local state will migrate automatically without an initialization decision. Run terraform init with reviewed state migration and confirm the resulting remote state has the intended lineage.

Question 45

A controlled cloud model operations assessment for a mobile marketplace operator concerns seller applications and buyer APIs. Reviewers find that a developer logs into HCP Terraform and initializes a root configuration connected to the wrong remote organization or workspace. The proposed remedy is to configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access. 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. CLI run target and backend metadata resolve to a different workspace than the approved deployment request
  2. HCP workspace team access shows broad permissions that do not match the documented separation of duties
  3. HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables
  4. HCP workspace is initially empty while a local state file already tracks live resources

Explanation

Correct Answer

A:

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. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access.

Incorrect Answers

B:

HCP workspace team access shows broad permissions that do not match the documented separation of duties. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access.

C:

HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables. CLI run target and backend metadata resolve to a different workspace than the approved deployment request. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access.

D:

HCP workspace is initially empty while a local state file already tracks live resources. CLI run target and backend metadata resolve to a different workspace than the approved deployment request. Configure the correct cloud block organization and workspace selection then authenticate with scoped CLI access.

Question 46

A controlled cloud model operations assessment for a regional bank technology group concerns payment and customer network systems. Reviewers find 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. 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. Runner audit shows an active workflow and lock ID belonging to the current legitimate writer
  2. File inspection shows provider attributes and sensitive infrastructure data readable by unrelated collaborators
  3. Removing the resource block from configuration causes plan to schedule DNS record deletion
  4. Backend folder has no state history while a local terraform.tfstate still maps production resources

Explanation

Correct Answer

B:

File inspection shows provider attributes and sensitive infrastructure data readable by unrelated collaborators. Terraform state can hold sensitive data regardless of a display-only sensitive flag. Restrict state file permissions and move to an approved secured backend with retention controls.

Incorrect Answers

A:

Runner audit shows an active workflow and lock ID belonging to the current legitimate writer. 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.

C:

Removing the resource block from configuration causes plan to schedule DNS record deletion. Restrict state file permissions and move to an approved secured backend with retention controls.

D:

Backend folder has no state history while a local terraform.tfstate still maps production resources. 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 47

For airfield and ticketing services at an aviation operations provider, the infrastructure platform team is investigating the following incident: a root configuration loads a network module from the default Git branch and overnight builds behave differently without a root change. The relevant evidence is that init logs show the same module source resolves to a newer commit than the reviewed deployment. The plan is to pin a reviewed module release tag or commit reference and validate compatibility before updating. Which Terraform design principle best explains the chosen response?

  1. Terraform module source syntax and registry access determine how reusable configuration is retrieved
  2. Each Terraform module has its own variable and local namespace with explicit input boundaries
  3. Module source addresses can be versioned or pinned to support repeatable composition
  4. Registry module versions require deliberate constraints to prevent surprise interface changes

Explanation

Correct Answer

C:

Module source addresses can be versioned or pinned to support repeatable composition. A root configuration loads a network module from the default Git branch and overnight builds behave differently without a root change. Pin a reviewed module release tag or commit reference and validate compatibility before updating.

Incorrect Answers

A:

Terraform module source syntax and registry access determine how reusable configuration is retrieved. A root configuration loads a network module from the default Git branch and overnight builds behave differently without a root change. Module source addresses can be versioned or pinned to support repeatable composition.

B:

Each Terraform module has its own variable and local namespace with explicit input boundaries. A root configuration loads a network module from the default Git branch and overnight builds behave differently without a root change. Module source addresses can be versioned or pinned to support repeatable composition.

D:

Registry module versions require deliberate constraints to prevent surprise interface changes. Module source addresses can be versioned or pinned to support repeatable composition.

Question 48

A controlled cloud model operations assessment for a market data company concerns analytics and private data feeds. Reviewers find that a project declares networking in two different public clouds but one credential block is incorrectly reused for both providers. The proposed remedy is to configure separate provider requirements and identity settings for each cloud and use each resource's intended provider. 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 reports an unsupported resource type for the local hypervisor despite successful cloud authentication
  2. Service change logs show DNS records updated after compute apply with no state-tracked Terraform dependency
  3. The replacement environment has different route tables and no reviewed record of the original console steps
  4. Initialization and apply errors show an authenticated provider for one platform and rejected API calls for the other

Explanation

Correct Answer

D:

Initialization and apply errors show an authenticated provider for one platform and rejected API calls for the other. Terraform orchestrates resources from multiple APIs through distinct provider plugins without requiring one universal credential. Configure separate provider requirements and identity settings for each cloud and use each resource's intended provider.

Incorrect Answers

A:

Plan reports an unsupported resource type for the local hypervisor despite successful cloud authentication. Initialization and apply errors show an authenticated provider for one platform and rejected API calls for the other. Configure separate provider requirements and identity settings for each cloud and use each resource's intended provider.

B:

Service change logs show DNS records updated after compute apply with no state-tracked Terraform dependency. Initialization and apply errors show an authenticated provider for one platform and rejected API calls for the other. Configure separate provider requirements and identity settings for each cloud and use each resource's intended provider.

C:

The replacement environment has different route tables and no reviewed record of the original console steps. Initialization and apply errors show an authenticated provider for one platform and rejected API calls for the other. Configure separate provider requirements and identity settings for each cloud and use each resource's intended provider.

Question 49

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. Confirming evidence shows that 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 implementation paired with its verification outcome addresses the same fault?

  1. Pass the explicit subnet output from the network module into the compute module — verify: The compute resource plans against the correct network output and module dependencies are inferred
  2. Pass the explicit subnet output from the network module into the compute module — verify: Adding one tenant changes only its keyed module instance rather than shifting other identities
  3. Pass the explicit subnet output from the network module into the compute module — verify: The necessary identifier flows through declared module interfaces while unrelated state remains private
  4. Define the child input variable and pass it explicitly in the module block — verify: The child receives approved values without accessing caller-only locals

Explanation

Correct Answer

A:

Pass the explicit subnet output from the network module into the compute module. The compute resource plans against the correct network output and module dependencies are inferred. Validate reports missing module argument even though the underlying network resource exists elsewhere. Module composition uses clearly declared inputs and outputs to connect independently reusable stacks.

Incorrect Answers

B:

Pass the explicit subnet output from the network module into the compute module. Adding one tenant changes only its keyed module instance rather than shifting other identities. The remedy may be appropriate, but that check does not establish the required recovery. The compute resource plans against the correct network output and module dependencies are inferred.

C:

Pass the explicit subnet output from the network module into the compute module. The necessary identifier flows through declared module interfaces while unrelated state remains private. The intervention addresses the fault, but the proposed test checks a different outcome. The compute resource plans against the correct network output and module dependencies are inferred.

D:

Define the child input variable and pass it explicitly in the module block. The child receives approved values without accessing caller-only locals. This pair concerns a different control or outcome, leaving the recorded fault unresolved. Pass the explicit subnet output from the network module into the compute module; The compute resource plans against the correct network output and module dependencies are inferred.

Question 50

For payment and customer network systems at a regional bank technology group, the infrastructure platform team is investigating the following incident: a module marks an output sensitive but a downstream script passes its raw value to a shell command that echoes it. The team proposes to protect consumers and state access and avoid printing sensitive outputs in downstream scripts. 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. Supported temporary secret values are omitted from plans and state for the specific write-only path
  2. Authorized automation consumes the secret without exposing it in logs or unprotected artifacts
  3. The plan reads the approved network identity without creating a duplicate
  4. No persistent token exists in Git or CI artifacts while authorized plans can retrieve temporary credentials

Explanation

Correct Answer

B:

Authorized automation consumes the secret without exposing it in logs or unprotected artifacts. A module marks an output sensitive but a downstream script passes its raw value to a shell command that echoes it. Protect consumers and state access and avoid printing sensitive outputs in downstream scripts.

Incorrect Answers

A:

Supported temporary secret values are omitted from plans and state for the specific write-only path. Authorized automation consumes the secret without exposing it in logs or unprotected artifacts.

C:

The plan reads the approved network identity without creating a duplicate. A module marks an output sensitive but a downstream script passes its raw value to a shell command that echoes it. Authorized automation consumes the secret without exposing it in logs or unprotected artifacts.

D:

No persistent token exists in Git or CI artifacts while authorized plans can retrieve temporary credentials. A module marks an output sensitive but a downstream script passes its raw value to a shell command that echoes it. Authorized automation consumes the secret without exposing it in logs or unprotected artifacts.

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