Practice Exams:

HashiCorp Terraform Associate 004 Dumps

EXAM: HashiCorp Certified: Terraform Associate (004)
Verified By Experts
Premium Bundle
$40.00
$59.97 $99.97

Terraform Associate 004 Premium Bundle


  • Premium File 167 Questions & Answers
  • Training Course 118 Lectures
  • Study Guide 285 Pages

HashiCorp Terraform Associate 004 Practice Test 1

Question 1

A delivery startup's staging VMs differ by engineer because each was created through a sequence of undocumented clicks and scripts. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.
  2. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.
  3. Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production.
  4. Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

Answer & Explanations

Correct answer: A

A.

Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. Verify the result with this test: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

B.

Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. This addresses “Separate Terraform's configuration from a runtime script for repeatable changes”, where the governing principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. The stated case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

C.

Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. This addresses “Require version control and review for infrastructure changes”, where the governing principle is: Reviewable declarative diffs connect infrastructure intent to approvals and support rollback investigation; console-only edits lose that history and change context. The stated case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. This addresses “Use repeatable Terraform runs to minimize configuration divergence”, where the governing principle is: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. The stated case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

Question 2

A delivery startup's staging VMs differ by engineer because each was created through a sequence of undocumented clicks and scripts. The infrastructure engineer proposes this change: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Which mechanism explains why it works?

  1. Reviewable declarative diffs connect infrastructure intent to approvals and support rollback investigation; console-only edits lose that history and change context.
  2. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.
  3. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.
  4. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

Answer & Explanations

Correct answer: D

A.

Reviewable declarative diffs connect infrastructure intent to approvals and support rollback investigation; console-only edits lose that history and change context. That explains “Require version control and review for infrastructure changes”, not the mechanism behind the described change. The relevant principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

B.

Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. That explains “Separate Terraform's configuration from a runtime script for repeatable changes”, not the mechanism behind the described change. The relevant principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

C.

A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. That explains “Use repeatable Terraform runs to minimize configuration divergence”, not the mechanism behind the described change. The relevant principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

D.

Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. The corresponding implementation is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

Question 3

A delivery startup's staging VMs differ by engineer because each was created through a sequence of undocumented clicks and scripts. After implementing this change—Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.—which test most directly validates its intended outcome?

  1. Create a pull request that changes a nonproduction tag, attach the expected plan, and verify the reviewer can trace the eventual apply to that commit.
  2. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  3. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  4. Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

Answer & Explanations

Correct answer: B

A.

Create a pull request that changes a nonproduction tag, attach the expected plan, and verify the reviewer can trace the eventual apply to that commit. That would help test “Require version control and review for infrastructure changes”, not the outcome required in this scenario. The relevant acceptance check is: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

B.

Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. This check is decisive because terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

C.

Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. That would help test “Separate Terraform's configuration from a runtime script for repeatable changes”, not the outcome required in this scenario. The relevant acceptance check is: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

D.

Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. That would help test “Use repeatable Terraform runs to minimize configuration divergence”, not the outcome required in this scenario. The relevant acceptance check is: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Question 4

A delivery startup's staging VMs differ by engineer because each was created through a sequence of undocumented clicks and scripts. Which proposed shortcut most directly risks inconsistent environments that cannot be reconstructed from reviewed configuration and should therefore be rejected?

  1. Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.
  2. Allow engineers to patch production cloud resources in the console with no repository change or documented review.
  3. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.
  4. Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

Answer & Explanations

Correct answer: C

A.

Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation. That shortcut risks drift between environments and repairs that do not propagate consistently. Here the specific shortcut is: Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.

B.

Allow engineers to patch production cloud resources in the console with no repository change or documented review. That shortcut risks infrastructure changes that cannot be audited or safely reproduced. Here the specific shortcut is: Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.

C.

Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source. The foreseeable failure is inconsistent environments that cannot be reconstructed from reviewed configuration. The safer response is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state. That shortcut risks untracked side effects and configuration drift hidden behind a seemingly successful apply. Here the specific shortcut is: Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.

Question 5

A delivery startup's staging VMs differ by engineer because each was created through a sequence of undocumented clicks and scripts. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  2. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  3. Implement: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Verify: Create a pull request that changes a nonproduction tag, attach the expected plan, and verify the reviewer can trace the eventual apply to that commit.
  4. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Answer & Explanations

Correct answer: D

A.

The action is applicable: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. But its proposed test—Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.—addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. This requirement is confirmed instead by: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

B.

The test would be relevant: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. But the offered implementation—Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.—addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. The action needed here is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

C.

This action/test pair addresses “Require version control and review for infrastructure changes”. Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Create a pull request that changes a nonproduction tag, attach the expected plan, and verify the reviewer can trace the eventual apply to that commit. The case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Confirm it through this test: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

Question 6

A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit.
  2. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.
  3. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.
  4. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit.

Answer & Explanations

Correct answer: B

A.

Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit. This addresses “Model different clouds using providers without assuming identical resources”, where the governing principle is: Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable. The stated case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

B.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. Verify the result with this test: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

C.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. This addresses “Separate Terraform's configuration from a runtime script for repeatable changes”, where the governing principle is: Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. The stated case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. This addresses “Manage hybrid infrastructure while respecting provider ownership”, where the governing principle is: A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API. The stated case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

Question 7

A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. The infrastructure engineer proposes this change: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Which mechanism explains why it works?

  1. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.
  2. Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable.
  3. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object.
  4. A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. The corresponding implementation is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

B.

Terraform uses provider-specific resource schemas behind a common configuration and workflow; a single language does not make unrelated cloud APIs interchangeable. That explains “Model different clouds using providers without assuming identical resources”, not the mechanism behind the described change. The relevant principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

C.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Terraform manages declared infrastructure lifecycle through provider APIs; running a provisioning shell script on every apply is not inherently a convergent description of an object. That explains “Separate Terraform's configuration from a runtime script for repeatable changes”, not the mechanism behind the described change. The relevant principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

D.

A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API. That explains “Manage hybrid infrastructure while respecting provider ownership”, not the mechanism behind the described change. The relevant principle is: Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

Question 8

A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. After implementing this change—Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.—which test most directly validates its intended outcome?

  1. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  2. Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs.
  3. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  4. Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. That would help test “Separate Terraform's configuration from a runtime script for repeatable changes”, not the outcome required in this scenario. The relevant acceptance check is: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

B.

Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs. That would help test “Model different clouds using providers without assuming identical resources”, not the outcome required in this scenario. The relevant acceptance check is: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

C.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. This check is decisive because terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

D.

Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. That would help test “Manage hybrid infrastructure while respecting provider ownership”, not the outcome required in this scenario. The relevant acceptance check is: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Question 9

A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Which proposed shortcut most directly risks inconsistent environments that cannot be reconstructed from reviewed configuration and should therefore be rejected?

  1. Assume Terraform automatically discovers and manages every on-premises device without installing a provider or declaring any resource.
  2. Assume a resource type named for one provider works unchanged in another cloud without declaring or adapting that provider's schema.
  3. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.
  4. Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state.

Answer & Explanations

Correct answer: C

A.

Assume Terraform automatically discovers and manages every on-premises device without installing a provider or declaring any resource. That shortcut risks silent omissions or incorrect changes across the cloud and private-network boundary. Here the specific shortcut is: Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.

B.

Assume a resource type named for one provider works unchanged in another cloud without declaring or adapting that provider's schema. That shortcut risks failed multi-cloud deployments caused by conflating common workflow with cloud-specific resource APIs. Here the specific shortcut is: Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.

C.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source. The foreseeable failure is inconsistent environments that cannot be reconstructed from reviewed configuration. The safer response is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Run a large mutable bootstrap script during every apply and assume repeated script side effects are harmless and represented in Terraform state. That shortcut risks untracked side effects and configuration drift hidden behind a seemingly successful apply. Here the specific shortcut is: Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.

Question 10

A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  2. Implement: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Verify: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  3. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  4. Implement: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Verify: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. The action is applicable: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. But its proposed test—Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.—addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. This requirement is confirmed instead by: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.

B.

This action/test pair addresses “Manage hybrid infrastructure while respecting provider ownership”. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. The case instead calls for: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

C.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. The test would be relevant: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. But the offered implementation—Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools.—addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. The action needed here is: Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

D.

The question is set in this situation: A university lab wants new assistants to reproduce the same test network without copying the last administrator's interactive shell history. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Confirm it through this test: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.

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