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 4

Question 30

A telecommunications operator wants reviewers to distinguish an intended load balancer update from a hidden manual console edit. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Verify: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  2. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  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: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. 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.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A telecommunications operator wants reviewers to distinguish an intended load balancer update from a hidden manual console edit. The action is applicable: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. But its proposed test—Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.—addresses “Use repeatable Terraform runs to minimize configuration divergence”. This requirement is confirmed instead by: 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.

B.

This action/test pair addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. The case instead calls for: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production.

C.

The question is set in this situation: A telecommunications operator wants reviewers to distinguish an intended load balancer update from a hidden manual console edit. Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Confirm it through this test: 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. Reviewable declarative diffs connect infrastructure intent to approvals and support rollback investigation; console-only edits lose that history and change context.

D.

The question is set in this situation: A telecommunications operator wants reviewers to distinguish an intended load balancer update from a hidden manual console edit. The test would be relevant: 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. But the offered implementation—Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.—addresses “Use repeatable Terraform runs to minimize configuration divergence”. The action needed here is: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production.

Question 31

A logistics firm maintains nearly identical test and staging clusters that have diverged because each was built from a separate copied script. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.
  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. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

Answer & Explanations

Correct answer: A

A.

Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. Verify the result with this test: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

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: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

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: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

D.

Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. This addresses “Use declarative configuration to describe desired infrastructure”, where the governing 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. The stated case instead calls for: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

Question 32

A logistics firm maintains nearly identical test and staging clusters that have diverged because each was built from a separate copied script. The infrastructure engineer proposes this change: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. 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. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.
  3. Reviewable declarative diffs connect infrastructure intent to approvals and support rollback investigation; console-only edits lose that history and change context.
  4. 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.

Answer & Explanations

Correct answer: B

A.

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

B.

A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. The corresponding implementation is: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

C.

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: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

D.

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: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

Question 33

A logistics firm maintains nearly identical test and staging clusters that have diverged because each was built from a separate copied script. After implementing this change—Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.—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. 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.
  3. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  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: D

A.

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: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

B.

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: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

C.

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

D.

Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. This check is decisive because a shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

Question 34

A logistics firm maintains nearly identical test and staging clusters that have diverged because each was built from a separate copied script. Which proposed shortcut most directly risks drift between environments and repairs that do not propagate consistently 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: A

A.

Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation. The foreseeable failure is drift between environments and repairs that do not propagate consistently. The safer response is: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

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: Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

C.

Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source. That shortcut risks inconsistent environments that cannot be reconstructed from reviewed configuration. Here the specific shortcut is: Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

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: Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

Question 35

A logistics firm maintains nearly identical test and staging clusters that have diverged because each was built from a separate copied script. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Verify: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  2. Implement: Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Verify: Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted.
  3. Implement: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. Verify: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  4. Implement: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. 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.

Answer & Explanations

Correct answer: C

A.

The test would be relevant: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. But the offered implementation—Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production.—addresses “Require version control and review for infrastructure changes”. The action needed here is: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

B.

This action/test pair addresses “Separate Terraform's configuration from a runtime script for repeatable changes”. Model durable network and compute objects with Terraform configuration while keeping application startup commands in appropriate software deployment tools. Apply the same configuration twice in a sandbox and confirm the second plan contains no infrastructure changes when remote state has not drifted. The case instead calls for: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

C.

Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. Confirm it through this test: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

D.

The action is applicable: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. But its proposed test—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.—addresses “Require version control and review for infrastructure changes”. This requirement is confirmed instead by: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

Question 36

A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production.
  2. Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.
  3. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit.
  4. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. 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: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

B.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. Verify the result with this test: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

C.

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: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

D.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. This addresses “Use declarative configuration to describe desired infrastructure”, where the governing 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. The stated case instead calls for: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

Question 37

A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. The infrastructure engineer proposes this change: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. 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 compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph.
  3. 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.
  4. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. 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: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

B.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Terraform compares configuration, state and observed remote objects to propose changes; ordinary shell provisioning steps instead describe imperative commands without an equivalent state graph. That explains “Use declarative configuration to describe desired infrastructure”, not the mechanism behind the described change. The relevant principle is: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

C.

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: A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

D.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution. The corresponding implementation is: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

Question 38

A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. After implementing this change—Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.—which test most directly validates its intended outcome?

  1. Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  2. 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.
  3. Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  4. 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: A

A.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. This check is decisive because a shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

B.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. 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: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

C.

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: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

D.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. That would help test “Use declarative configuration to describe desired infrastructure”, not the outcome required in this scenario. The relevant acceptance check is: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

Question 39

A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Which proposed shortcut most directly risks drift between environments and repairs that do not propagate consistently and should therefore be rejected?

  1. Allow engineers to patch production cloud resources in the console with no repository change or documented review.
  2. Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.
  3. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source.
  4. Assume Terraform automatically discovers and manages every on-premises device without installing a provider or declaring any resource.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. 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: Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

B.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation. The foreseeable failure is drift between environments and repairs that do not propagate consistently. The safer response is: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

C.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Write one-off console commands on each engineer's laptop and claim the resulting environment is reproducible from a declarative source. That shortcut risks inconsistent environments that cannot be reconstructed from reviewed configuration. Here the specific shortcut is: Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

D.

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: Duplicate hundreds of infrastructure declarations into unrelated directories and patch each differently without any shared module or validation.

Question 40

A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. 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: Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources.
  2. Implement: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Verify: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  3. Implement: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. Verify: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.
  4. Implement: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. 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.

Answer & Explanations

Correct answer: C

A.

This action/test pair addresses “Use declarative configuration to describe desired infrastructure”. Write versioned Terraform resource blocks describing required cloud objects, and use a plan to reconcile actual infrastructure toward that desired state. Change a disposable resource property, run terraform plan, and verify the proposed update matches the declared value without recreating unaffected resources. The case instead calls for: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

B.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. The test would be relevant: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. But the offered implementation—Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production.—addresses “Require version control and review for infrastructure changes”. The action needed here is: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually.

C.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. Confirm it through this test: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts. A shared configuration and input contract reduce divergent hand-written deployments, while Terraform's plan makes environment differences explicit before execution.

D.

The question is set in this situation: A nonprofit opens temporary training sandboxes and wants consistent network policies while allowing smaller instance sizes in each sandbox. The action is applicable: Maintain one reusable configuration pattern with explicit per-environment inputs and run it consistently rather than copying and modifying entire cloud stacks manually. But its proposed test—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.—addresses “Require version control and review for infrastructure changes”. This requirement is confirmed instead by: Provision two disposable environments from the same module using separate inputs and verify their shared structural attributes match their intended contracts.

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