HashiCorp Terraform Associate 004 Dumps
HashiCorp Terraform Associate 004 Practice Test 45
Question 440
A healthcare application obtains short-lived Vault credentials during Terraform execution and must pass them only into supported ephemeral contexts. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: A
The question is set in this situation: A healthcare application obtains short-lived Vault credentials during Terraform execution and must pass them only into supported ephemeral contexts. Use an ephemeral variable or resource with a supported provider write-only argument, and manage any companion version attribute when rotating secrets. Confirm it through this test: Run a disposable rotation using a documented write-only argument, inspect artifacts for omitted secret text and confirm the version attribute triggers the expected update. Ephemeral values and write-only arguments can avoid storing the temporary secret in Terraform plan and state, unlike sensitive flags alone; providers must support them.
This action/test pair addresses “Use depends_on only for otherwise hidden dependencies”. Add explicit depends_on on a resource or module only when the downstream operation relies on an upstream side effect not represented by a direct attribute reference. Create a test dependency without a data reference, inspect graph ordering, and remove the explicit dependency to show why a direct reference would be preferable when possible. The case instead calls for: Use an ephemeral variable or resource with a supported provider write-only argument, and manage any companion version attribute when rotating secrets.
The question is set in this situation: A healthcare application obtains short-lived Vault credentials during Terraform execution and must pass them only into supported ephemeral contexts. The action is applicable: Use an ephemeral variable or resource with a supported provider write-only argument, and manage any companion version attribute when rotating secrets. But its proposed test—Apply a disposable nonproduction secret-shaped value, inspect state access policies and confirm no secret is printed in ordinary plan text.—addresses “Treat sensitive flags as display masking rather than zero-persistence”. This requirement is confirmed instead by: Run a disposable rotation using a documented write-only argument, inspect artifacts for omitted secret text and confirm the version attribute triggers the expected update.
The question is set in this situation: A healthcare application obtains short-lived Vault credentials during Terraform execution and must pass them only into supported ephemeral contexts. The test would be relevant: Run a disposable rotation using a documented write-only argument, inspect artifacts for omitted secret text and confirm the version attribute triggers the expected update. But the offered implementation—Mark confidential input variables sensitive, avoid displaying them in outputs, and separately protect state, plan files and credential injection paths.—addresses “Treat sensitive flags as display masking rather than zero-persistence”. The action needed here is: Use an ephemeral variable or resource with a supported provider write-only argument, and manage any companion version attribute when rotating secrets.
Question 441
A startup maintains one internal test-network module under modules/network and wants multiple application environments to reuse it. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?
Answer & Explanations
Correct answer: A
Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically. Verify the result with this test: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. This addresses “Compose multiple modules through explicit input and output interfaces”, where the governing principle is: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership. The stated case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Select a published module source from the correct Terraform Registry namespace and supply a compatible, reviewed module version in the module block. This addresses “Use Terraform Registry module sources with intentional version selection”, where the governing principle is: Registry sources resolve reusable module packages separately from provider plugins, and a module version controls the downloaded configuration interface. The stated case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Reference an approved version tag or immutable commit reference when using a Git-sourced Terraform module instead of an uncontrolled branch tip. This addresses “Freeze non-Registry module source at a known Git revision”, where the governing principle is: Git module sources can follow moving branches unless ref is pinned; Terraform init downloads code from the specified source reference. The stated case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Question 442
A startup maintains one internal test-network module under modules/network and wants multiple application environments to reuse it. The infrastructure engineer proposes this change: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. Which mechanism explains why it works?
Answer & Explanations
Correct answer: C
Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership. That explains “Compose multiple modules through explicit input and output interfaces”, not the mechanism behind the described change. The relevant principle is: A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
Registry sources resolve reusable module packages separately from provider plugins, and a module version controls the downloaded configuration interface. That explains “Use Terraform Registry module sources with intentional version selection”, not the mechanism behind the described change. The relevant principle is: A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically. The corresponding implementation is: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Git module sources can follow moving branches unless ref is pinned; Terraform init downloads code from the specified source reference. That explains “Freeze non-Registry module source at a known Git revision”, not the mechanism behind the described change. The relevant principle is: A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
Question 443
A startup maintains one internal test-network module under modules/network and wants multiple application environments to reuse it. After implementing this change—Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.—which test most directly validates its intended outcome?
Answer & Explanations
Correct answer: D
Initialize a disposable registry module at a pinned version and confirm source, input requirements and downloaded module path before planning changes. That would help test “Use Terraform Registry module sources with intentional version selection”, not the outcome required in this scenario. The relevant acceptance check is: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
Initialize a sandbox with a fixed commit-ref module, verify its source checksum and compare a later version in a separately reviewed branch. That would help test “Freeze non-Registry module source at a known Git revision”, not the outcome required in this scenario. The relevant acceptance check is: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. That would help test “Compose multiple modules through explicit input and output interfaces”, not the outcome required in this scenario. The relevant acceptance check is: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. This check is decisive because a child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
Question 444
A startup maintains one internal test-network module under modules/network and wants multiple application environments to reuse it. Which proposed shortcut most directly risks divergent repeated infrastructure definitions with no clear module boundary and should therefore be rejected?
Answer & Explanations
Correct answer: B
Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module. That shortcut risks broken application connectivity after network replacement or environment migration. Here the specific shortcut is: Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface. The foreseeable failure is divergent repeated infrastructure definitions with no clear module boundary. The safer response is: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Select an unknown third-party registry module at an unreviewed latest release and apply its resources in a sensitive account immediately. That shortcut risks unexpected infrastructure changes or untrusted code entering a shared deployment. Here the specific shortcut is: Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
Point production at the main branch of a remote module repository and assume each CI runner executes identical unchanged code forever. That shortcut risks unreviewed remote module changes entering production infrastructure plans. Here the specific shortcut is: Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
Question 445
A startup maintains one internal test-network module under modules/network and wants multiple application environments to reuse it. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: A
Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. Confirm it through this test: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
This action/test pair addresses “Compose multiple modules through explicit input and output interfaces”. Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. The case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
The action is applicable: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. But its proposed test—Initialize a disposable registry module at a pinned version and confirm source, input requirements and downloaded module path before planning changes.—addresses “Use Terraform Registry module sources with intentional version selection”. This requirement is confirmed instead by: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
The test would be relevant: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. But the offered implementation—Select a published module source from the correct Terraform Registry namespace and supply a compatible, reviewed module version in the module block.—addresses “Use Terraform Registry module sources with intentional version selection”. The action needed here is: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Question 446
A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?
Answer & Explanations
Correct answer: C
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Reference an approved version tag or immutable commit reference when using a Git-sourced Terraform module instead of an uncontrolled branch tip. This addresses “Freeze non-Registry module source at a known Git revision”, where the governing principle is: Git module sources can follow moving branches unless ref is pinned; Terraform init downloads code from the specified source reference. The stated case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Set a reviewed version constraint for a registry module and upgrade intentionally after inspecting its release notes, interface and plan effects. This addresses “Pin compatible Registry module versions for repeatable changes”, where the governing principle is: Registry module version selection is independent of provider version selection, so a module release can change resources even if the provider lock remains unchanged. The stated case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically. Verify the result with this test: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Select a published module source from the correct Terraform Registry namespace and supply a compatible, reviewed module version in the module block. This addresses “Use Terraform Registry module sources with intentional version selection”, where the governing principle is: Registry sources resolve reusable module packages separately from provider plugins, and a module version controls the downloaded configuration interface. The stated case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
Question 447
A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. The infrastructure engineer proposes this change: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. Which mechanism explains why it works?
Answer & Explanations
Correct answer: B
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Git module sources can follow moving branches unless ref is pinned; Terraform init downloads code from the specified source reference. That explains “Freeze non-Registry module source at a known Git revision”, not the mechanism behind the described change. The relevant principle is: A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically. The corresponding implementation is: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Registry sources resolve reusable module packages separately from provider plugins, and a module version controls the downloaded configuration interface. That explains “Use Terraform Registry module sources with intentional version selection”, not the mechanism behind the described change. The relevant principle is: A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
Registry module version selection is independent of provider version selection, so a module release can change resources even if the provider lock remains unchanged. That explains “Pin compatible Registry module versions for repeatable changes”, not the mechanism behind the described change. The relevant principle is: A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
Question 448
A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. After implementing this change—Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.—which test most directly validates its intended outcome?
Answer & Explanations
Correct answer: D
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Initialize a sandbox with a fixed commit-ref module, verify its source checksum and compare a later version in a separately reviewed branch. That would help test “Freeze non-Registry module source at a known Git revision”, not the outcome required in this scenario. The relevant acceptance check is: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Initialize a disposable registry module at a pinned version and confirm source, input requirements and downloaded module path before planning changes. That would help test “Use Terraform Registry module sources with intentional version selection”, not the outcome required in this scenario. The relevant acceptance check is: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
Initialize the same root module at two selected releases, inspect downloaded code and compare plans before authorizing an upgrade. That would help test “Pin compatible Registry module versions for repeatable changes”, not the outcome required in this scenario. The relevant acceptance check is: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. This check is decisive because a child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
Question 449
A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Which proposed shortcut most directly risks divergent repeated infrastructure definitions with no clear module boundary and should therefore be rejected?
Answer & Explanations
Correct answer: A
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface. The foreseeable failure is divergent repeated infrastructure definitions with no clear module boundary. The safer response is: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Select an unknown third-party registry module at an unreviewed latest release and apply its resources in a sensitive account immediately. That shortcut risks unexpected infrastructure changes or untrusted code entering a shared deployment. Here the specific shortcut is: Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
Remove the module version argument and assume provider lock-file hashes freeze all module source changes automatically. That shortcut risks unexpected module interface or resource changes after unreviewed dependency updates. Here the specific shortcut is: Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Point production at the main branch of a remote module repository and assume each CI runner executes identical unchanged code forever. That shortcut risks unreviewed remote module changes entering production infrastructure plans. Here the specific shortcut is: Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
Question 450
A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: C
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. The action is applicable: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. But its proposed test—Initialize a disposable registry module at a pinned version and confirm source, input requirements and downloaded module path before planning changes.—addresses “Use Terraform Registry module sources with intentional version selection”. This requirement is confirmed instead by: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
This action/test pair addresses “Freeze non-Registry module source at a known Git revision”. Reference an approved version tag or immutable commit reference when using a Git-sourced Terraform module instead of an uncontrolled branch tip. Initialize a sandbox with a fixed commit-ref module, verify its source checksum and compare a later version in a separately reviewed branch. The case instead calls for: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. Confirm it through this test: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. A child module groups its own resources and is loaded from the source path during initialization; module blocks do not clone active remote resources automatically.
The question is set in this situation: A university Terraform repository has a teaching module for creating a sandbox subnet and several small root configurations should call it. The test would be relevant: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. But the offered implementation—Select a published module source from the correct Terraform Registry namespace and supply a compatible, reviewed module version in the module block.—addresses “Use Terraform Registry module sources with intentional version selection”. The action needed here is: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests
- HashiCorp Terraform Associate 004 Practice Test 43 - 10 Questions (Last Reviewed 17-Oct-2026)
- HashiCorp Terraform Associate 004 Practice Test 44 - 10 Questions (Last Reviewed 16-Oct-2026)
- HashiCorp Terraform Associate 004 Practice Test 45 - 10 Questions (Last Reviewed 15-Oct-2026)
- HashiCorp Terraform Associate 004 Practice Test 46 - 10 Questions (Last Reviewed 14-Oct-2026)
- HashiCorp Terraform Associate 004 Practice Test 47 - 10 Questions (Last Reviewed 13-Oct-2026)