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

Question 590

For satellite data ingest and model systems at a geospatial analytics startup, the infrastructure platform team is investigating the following incident: a team wants to reference a pre-existing network yet declares a second managed network resource that Terraform plans to create. The relevant evidence is that execution plan shows a new network instead of reading the existing network identified in service inventory. The plan is to use a supported data source to query the existing network and reference its attributes from managed resources. Which Terraform design principle best explains the chosen response?

  1. Lifecycle ignore_changes can hide drift and should be scoped only to intentionally externally managed fields
  2. Data blocks query existing information whereas resource blocks manage lifecycle of declared objects
  3. Write-only arguments need provider-defined change triggers because Terraform does not store their previous secret values
  4. Secret management should externalize short-lived credentials and minimize exposure in configuration and state

Explanation

Correct Answer

B:

Data blocks query existing information whereas resource blocks manage lifecycle of declared objects. A team wants to reference a pre-existing network yet declares a second managed network resource that Terraform plans to create. Use a supported data source to query the existing network and reference its attributes from managed resources.

Incorrect Answers

A:

Lifecycle ignore_changes can hide drift and should be scoped only to intentionally externally managed fields. Data blocks query existing information whereas resource blocks manage lifecycle of declared objects.

C:

Write-only arguments need provider-defined change triggers because Terraform does not store their previous secret values. A team wants to reference a pre-existing network yet declares a second managed network resource that Terraform plans to create. Data blocks query existing information whereas resource blocks manage lifecycle of declared objects.

D:

Secret management should externalize short-lived credentials and minimize exposure in configuration and state. A team wants to reference a pre-existing network yet declares a second managed network resource that Terraform plans to create. Data blocks query existing information whereas resource blocks manage lifecycle of declared objects.

Question 591

For freight scheduling and depot services at a logistics technology company, the infrastructure platform team is investigating the following incident: after code organization a storage resource moves into a module, Terraform plan proposes destroy and create despite unchanged cloud identity. Confirming evidence shows that state still maps the old root address and the module reference has a different new address. Only a controlled and reversible ML workflow change fits the approved release window. Which implementation paired with its verification outcome addresses the same fault?

  1. Use moved blocks or deliberate reviewed terraform state mv for address refactoring — verify: The DNS record remains externally managed and is no longer in this Terraform state's ownership
  2. Use moved blocks or deliberate reviewed terraform state mv for address refactoring — verify: Each environment plan shows only its own managed objects and account resources
  3. Use moved blocks or deliberate reviewed terraform state mv for address refactoring — verify: The resource maps to its new address without recreating or reimporting the remote object
  4. Use an approved backend with effective state locking and serialize applies for the same state — verify: A second writer waits or fails safely while a first authorized apply holds the lock

Explanation

Correct Answer

C:

Use moved blocks or deliberate reviewed terraform state mv for address refactoring. The resource maps to its new address without recreating or reimporting the remote object. State still maps the old root address and the module reference has a different new address. State moves preserve resource identity across Terraform address refactoring.

Incorrect Answers

A:

Use moved blocks or deliberate reviewed terraform state mv for address refactoring. The DNS record remains externally managed and is no longer in this Terraform state's ownership. The remedy may be appropriate, but that check does not establish the required recovery. The resource maps to its new address without recreating or reimporting the remote object.

B:

Use moved blocks or deliberate reviewed terraform state mv for address refactoring. Each environment plan shows only its own managed objects and account resources. The intervention addresses the fault, but the proposed test checks a different outcome. The resource maps to its new address without recreating or reimporting the remote object.

D:

Use an approved backend with effective state locking and serialize applies for the same state. A second writer waits or fails safely while a first authorized apply holds the lock. Use moved blocks or deliberate reviewed terraform state mv for address refactoring; The resource maps to its new address without recreating or reimporting the remote object.

Question 592

While protecting route planning and passenger dashboards, the Terraform team at a public transit administration confirms that a branch passes terraform fmt but contains an invalid reference to a nonexistent module output. The team proposes to use terraform validate for structural checks in addition to terraform fmt for formatting. 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. A no-change plan remains non-mutating while approved replacements are separately auditable
  2. The disposable test state is destroyed while production resources remain unchanged
  3. Initialization installs required plugins and creates valid local working metadata for planning
  4. The configuration is both consistently formatted and structurally valid before planning

Explanation

Correct Answer

D:

The configuration is both consistently formatted and structurally valid before planning. While protecting route planning and passenger dashboards, the file layout is formatted yet terraform validate reports an undeclared reference. Use terraform validate for structural checks in addition to terraform fmt for formatting.

Incorrect Answers

A:

A no-change plan remains non-mutating while approved replacements are separately auditable. The file layout is formatted yet terraform validate reports an undeclared reference. The configuration is both consistently formatted and structurally valid before planning.

B:

The disposable test state is destroyed while production resources remain unchanged. The file layout is formatted yet terraform validate reports an undeclared reference. The configuration is both consistently formatted and structurally valid before planning.

C:

Initialization installs required plugins and creates valid local working metadata for planning. The configuration is both consistently formatted and structurally valid before planning.

Question 593

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 build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. Confirming evidence shows that the working directory has no downloaded plugin and init has not been executed for the current configuration. Only a controlled and reversible ML workflow change fits the approved release window. Which implementation paired with its verification outcome addresses the same fault?

  1. Run terraform init in the correct root module and preserve approved dependency lock metadata — verify: The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources
  2. Run terraform init in the correct root module and preserve approved dependency lock metadata — verify: A subsequent plan recognizes the existing object under the new address without replacing it
  3. Run terraform init in the correct root module and preserve approved dependency lock metadata — verify: The reviewed plan targets the specified regions independently with the expected credentials
  4. 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

Explanation

Correct Answer

A:

Run terraform init in the correct root module and preserve approved dependency lock metadata. At a global university IT team, the needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources. A build container includes the Terraform CLI but no initialized plugin directory and attempts to plan a configuration using third-party resources. Terraform core uses externally installed provider plugins to understand managed resource schemas and API behavior.

Incorrect Answers

B:

Run terraform init in the correct root module and preserve approved dependency lock metadata. A subsequent plan recognizes the existing object under the new address without replacing it. That uses the intended change yet measures the wrong result. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources.

C:

Run terraform init in the correct root module and preserve approved dependency lock metadata. The reviewed plan targets the specified regions independently with the expected credentials. The remedy may be appropriate, but that check does not establish the required recovery. The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources.

D:

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. Run terraform init in the correct root module and preserve approved dependency lock metadata; The needed provider plugin is installed and the subsequent plan can ask the provider to evaluate resources.

Question 594

While protecting warehouse and supply chain services, the Terraform team at a food distribution operator confirms that a centrally managed variable set intended for a sandbox project is applied at organization scope and changes credentials used by production workspaces. The proposed remedy is to limit variable sets to appropriate projects or workspaces and verify precedence and attachments. 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. Deployment repository contains unversioned module copies with no approved registry version or provenance
  2. HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables
  3. HCP workspace team access shows broad permissions that do not match the documented separation of duties
  4. HCP run history lacks approved changes while cloud audit records show workstation-origin operations

Explanation

Correct Answer

B:

HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables. A centrally managed variable set intended for a sandbox project is applied at organization scope and changes credentials used by production workspaces. Limit variable sets to appropriate projects or workspaces and verify precedence and attachments.

Incorrect Answers

A:

Deployment repository contains unversioned module copies with no approved registry version or provenance. HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables. Limit variable sets to appropriate projects or workspaces and verify precedence and attachments.

C:

HCP workspace team access shows broad permissions that do not match the documented separation of duties. HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables. Limit variable sets to appropriate projects or workspaces and verify precedence and attachments.

D:

HCP run history lacks approved changes while cloud audit records show workstation-origin operations. HCP variable-set attachment page shows the wrong broad scope and affected workspace runs reference the unexpected variables. Limit variable sets to appropriate projects or workspaces and verify precedence and attachments.

Question 595

While protecting regulated clinical workflow infrastructure, the Terraform team at a healthcare software provider confirms that an infrastructure module ignores changes to security group rules and fails to detect an unauthorized open ingress addition. The proposed remedy is to remove unjustified ignore_changes and make the intended rules explicit, then review the corrective plan. 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 does not show the expected credential rotation and provider logs show no update request
  2. Data source output identifies an owner and image ID that do not match the security-approved catalog
  3. Plan shows no rule correction despite provider inventory showing a broad network access change
  4. Validation output points to a resource address that is not declared in the current module

Explanation

Correct Answer

C:

Plan shows no rule correction despite provider inventory showing a broad network access change. While protecting regulated clinical workflow infrastructure, an infrastructure module ignores changes to security group rules and fails to detect an unauthorized open ingress addition. An unauthorized rule deviation is detected and the approved policy can be reconciled.

Incorrect Answers

A:

Plan does not show the expected credential rotation and provider logs show no update request. Plan shows no rule correction despite provider inventory showing a broad network access change.

B:

Data source output identifies an owner and image ID that do not match the security-approved catalog. Plan shows no rule correction despite provider inventory showing a broad network access change.

D:

Validation output points to a resource address that is not declared in the current module. Plan shows no rule correction despite provider inventory showing a broad network access change.

Question 596

During an authorized design and operations review at a food distribution operator, engineers supporting warehouse and supply chain services discover that a module refers to a resource instance by an old local name and terraform validate cannot resolve its attribute. The proposed remedy is to use the correct resource type name label and indexed instance address when count or for_each is active. 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 contains only one nested rule and ignores additional values from the approved input list
  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. Validation output points to a resource address that is not declared in the current module

Explanation

Correct Answer

D:

Validation output points to a resource address that is not declared in the current module. Terraform references must use valid scoped resource addresses and instance keys. Use the correct resource type name label and indexed instance address when count or for_each is active.

Incorrect Answers

A:

Plan contains only one nested rule and ignores additional values from the approved input list. Use the correct resource type name label and indexed instance address when count or for_each is active.

B:

Input evaluation reports a default variable value and planned network is in the staging CIDR range. Validation output points to a resource address that is not declared in the current module. Use the correct resource type name label and indexed instance address when count or for_each is active.

C:

Provider returns a successful create while endpoint output points to an unexpected destination. Validation output points to a resource address that is not declared in the current module. Use the correct resource type name label and indexed instance address when count or for_each is active.

Question 597

During an authorized design and operations review at an insurance technology provider, engineers supporting claims workflow and secure identity systems discover that two automation runners begin applying against the same backend and each plans from the same original serial. The team proposes to use an approved backend with effective state locking and serialize applies for the same state. Any change must preserve the approved model contract and show measurable verification evidence. Which post-change observation would establish the required infrastructure or configuration outcome?

  1. A second writer waits or fails safely while a first authorized apply holds the lock
  2. Separate runs read the same authoritative state and no duplicate resources are proposed
  3. Authorized workspace reads the original managed identities from the remote backend and local copies are controlled
  4. Each environment plan shows only its own managed objects and account resources

Explanation

Correct Answer

A:

A second writer waits or fails safely while a first authorized apply holds the lock. Backend logs show overlapping writer attempts and conflicting state update errors. Use an approved backend with effective state locking and serialize applies for the same state.

Incorrect Answers

B:

Separate runs read the same authoritative state and no duplicate resources are proposed. A second writer waits or fails safely while a first authorized apply holds the lock.

C:

Authorized workspace reads the original managed identities from the remote backend and local copies are controlled. Backend logs show overlapping writer attempts and conflicting state update errors. A second writer waits or fails safely while a first authorized apply holds the lock.

D:

Each environment plan shows only its own managed objects and account resources. Backend logs show overlapping writer attempts and conflicting state update errors. A second writer waits or fails safely while a first authorized apply holds the lock.

Question 598

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 module refers to a resource instance by an old local name and terraform validate cannot resolve its attribute. The team proposes to use the correct resource type name label and indexed instance address when count or for_each is active. 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. Generated names match required patterns for all allowed inputs
  2. References resolve without fabricating hard-coded IDs and the plan graph includes the intended relationship
  3. The root obtains the intended nonsecret value through the module interface without reaching into internals
  4. A replacement becomes available before the original is removed and validation catches name conflicts

Explanation

Correct Answer

B:

References resolve without fabricating hard-coded IDs and the plan graph includes the intended relationship. At a telecom platform operator, validation output points to a resource address that is not declared in the current module. Use the correct resource type name label and indexed instance address when count or for_each is active.

Incorrect Answers

A:

Generated names match required patterns for all allowed inputs. At a telecom platform operator, validation output points to a resource address that is not declared in the current module. References resolve without fabricating hard-coded IDs and the plan graph includes the intended relationship.

C:

The root obtains the intended nonsecret value through the module interface without reaching into internals. At a telecom platform operator, references resolve without fabricating hard-coded IDs and the plan graph includes the intended relationship.

D:

A replacement becomes available before the original is removed and validation catches name conflicts. Validation output points to a resource address that is not declared in the current module. References resolve without fabricating hard-coded IDs and the plan graph includes the intended relationship.

Question 599

While protecting satellite data ingest and model systems, the Terraform team at a geospatial analytics startup confirms that a project declares networking in two different public clouds but one credential block is incorrectly reused for both providers. The relevant evidence is that initialization and apply errors show an authenticated provider for one platform and rejected API calls for the other. The plan is to configure separate provider requirements and identity settings for each cloud and use each resource's intended provider. Which Terraform design principle best explains the chosen response?

  1. Terraform supports noncompute service APIs through providers as well as public cloud infrastructure
  2. Reusable declarative patterns reduce environment drift and duplicated manual provisioning work
  3. Terraform orchestrates resources from multiple APIs through distinct provider plugins without requiring one universal credential
  4. Declarative management supplies a shared source of intended resource configuration rather than relying on memory or manual notes

Explanation

Correct Answer

C:

Terraform orchestrates resources from multiple APIs through distinct provider plugins without requiring one universal credential. A project declares networking in two different public clouds but one credential block is incorrectly reused for both providers. Configure separate provider requirements and identity settings for each cloud and use each resource's intended provider.

Incorrect Answers

A:

Terraform supports noncompute service APIs through providers as well as public cloud infrastructure. A project declares networking in two different public clouds but one credential block is incorrectly reused for both providers. Terraform orchestrates resources from multiple APIs through distinct provider plugins without requiring one universal credential.

B:

Reusable declarative patterns reduce environment drift and duplicated manual provisioning work. A project declares networking in two different public clouds but one credential block is incorrectly reused for both providers. Terraform orchestrates resources from multiple APIs through distinct provider plugins without requiring one universal credential.

D:

Declarative management supplies a shared source of intended resource configuration rather than relying on memory or manual notes. Terraform orchestrates resources from multiple APIs through distinct provider plugins without requiring one universal credential.

Question 600

While protecting metering and outage response, the Terraform team at an energy infrastructure operator confirms that a shared module repository accumulates inconsistent alignment and spacing changes that obscure meaningful resource edits. Observation: code review diffs contain indentation churn even when blocks have identical meaning. 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. Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow
  2. Confirm backend and workspace identity and require explicit approved targeting before destructive cleanup
  3. Inspect the complete plan and correct the unapproved argument change before any apply
  4. Run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes

Explanation

Correct Answer

D:

Run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes. Code review diffs contain indentation churn even when blocks have identical meaning. The repository follows stable canonical HCL formatting without infrastructure mutations.

Incorrect Answers

A:

Use terraform fmt -check for non-mutating validation and run formatter explicitly in the contributor workflow. Code review diffs contain indentation churn even when blocks have identical meaning. Run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes.

B:

Confirm backend and workspace identity and require explicit approved targeting before destructive cleanup. Code review diffs contain indentation churn even when blocks have identical meaning. Run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes.

C:

Inspect the complete plan and correct the unapproved argument change before any apply. Code review diffs contain indentation churn even when blocks have identical meaning. Run terraform fmt -recursive for controlled directory formatting and commit the resulting source-only changes.

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