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 49

Question 480

A university cloud lab composes two child modules and requires one to consume the other's reviewed output without copying resource IDs. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Declare typed input variables within a child module and provide matching arguments from the root module rather than assuming lexical access to root locals. Verify: Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error.
  2. Implement: Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. Verify: Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error.
  3. Implement: Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. Verify: Call a test child module with two different inputs and verify its output changes, then omit one required input and confirm an error occurs.
  4. Implement: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Verify: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A university cloud lab composes two child modules and requires one to consume the other's reviewed output without copying resource IDs. The test would be relevant: Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error. But the offered implementation—Declare typed input variables within a child module and provide matching arguments from the root module rather than assuming lexical access to root locals.—addresses “Pass values into child module inputs explicitly”. The action needed here is: Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root.

B.

The question is set in this situation: A university cloud lab composes two child modules and requires one to consume the other's reviewed output without copying resource IDs. Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. Confirm it through this test: Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error. Module outputs form an intentional interface, while the caller cannot reliably reference arbitrary nested resource attributes without such a contract.

C.

The question is set in this situation: A university cloud lab composes two child modules and requires one to consume the other's reviewed output without copying resource IDs. The action is applicable: Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. But its proposed test—Call a test child module with two different inputs and verify its output changes, then omit one required input and confirm an error occurs.—addresses “Pass values into child module inputs explicitly”. This requirement is confirmed instead by: Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error.

D.

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: Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root.

Question 481

A logistics SaaS product deploys a shared virtual network module and several independent app modules that must follow its subnet outputs. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Set a reviewed version constraint for a registry module and upgrade intentionally after inspecting its release notes, interface and plan effects.
  2. Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration.
  3. Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.
  4. Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key.

Answer & Explanations

Correct answer: C

A.

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: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

B.

Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. This addresses “Reference a local child module using an explicit filesystem source”, where the governing 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 stated case instead calls for: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

C.

Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership. Verify the result with this test: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

D.

Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key. This addresses “Instantiate a module repeatedly with stable for_each keys”, where the governing principle is: Repeated module blocks have keyed Terraform addresses and separate resource instance groups; removing one key need not reorder the remaining deployments. The stated case instead calls for: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

Question 482

A logistics SaaS product deploys a shared virtual network module and several independent app modules that must follow its subnet outputs. The infrastructure engineer proposes this change: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Which mechanism explains why it works?

  1. Repeated module blocks have keyed Terraform addresses and separate resource instance groups; removing one key need not reorder the remaining deployments.
  2. Registry module version selection is independent of provider version selection, so a module release can change resources even if the provider lock remains unchanged.
  3. 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.
  4. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

Answer & Explanations

Correct answer: D

A.

Repeated module blocks have keyed Terraform addresses and separate resource instance groups; removing one key need not reorder the remaining deployments. That explains “Instantiate a module repeatedly with stable for_each keys”, not the mechanism behind the described change. The relevant principle is: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

B.

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: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

C.

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. That explains “Reference a local child module using an explicit filesystem source”, not the mechanism behind the described change. The relevant principle is: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

D.

Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership. The corresponding implementation is: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

Question 483

A logistics SaaS product deploys a shared virtual network module and several independent app modules that must follow its subnet outputs. After implementing this change—Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.—which test most directly validates its intended outcome?

  1. Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.
  2. Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable.
  3. Initialize the same root module at two selected releases, inspect downloaded code and compare plans before authorizing an upgrade.
  4. Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.

Answer & Explanations

Correct answer: A

A.

Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. This check is decisive because cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

B.

Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable. That would help test “Instantiate a module repeatedly with stable for_each keys”, not the outcome required in this scenario. The relevant acceptance check is: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

C.

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: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

D.

Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name. That would help test “Reference a local child module using an explicit filesystem source”, not the outcome required in this scenario. The relevant acceptance check is: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

Question 484

A logistics SaaS product deploys a shared virtual network module and several independent app modules that must follow its subnet outputs. Which proposed shortcut most directly risks broken application connectivity after network replacement or environment migration and should therefore be rejected?

  1. Remove the module version argument and assume provider lock-file hashes freeze all module source changes automatically.
  2. Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.
  3. Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface.
  4. Use positional count over a frequently reordered environment list and assume module instance identities are unaffected by inserting new entries.

Answer & Explanations

Correct answer: B

A.

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: Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

B.

Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module. The foreseeable failure is broken application connectivity after network replacement or environment migration. The safer response is: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

C.

Copy the module's resource blocks into every caller manually and assume the duplicated copies share a single versioned interface. That shortcut risks divergent repeated infrastructure definitions with no clear module boundary. Here the specific shortcut is: Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

D.

Use positional count over a frequently reordered environment list and assume module instance identities are unaffected by inserting new entries. That shortcut risks unnecessary resource replacements from unstable repeated module addresses. Here the specific shortcut is: Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

Question 485

A logistics SaaS product deploys a shared virtual network module and several independent app modules that must follow its subnet outputs. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Verify: Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable.
  2. Implement: Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key. Verify: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.
  3. Implement: Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. Verify: Run terraform init in a fixture containing a local module, then plan to confirm its resource addresses are prefixed by the module call name.
  4. Implement: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Verify: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

Answer & Explanations

Correct answer: D

A.

The action is applicable: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. But its proposed test—Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable.—addresses “Instantiate a module repeatedly with stable for_each keys”. This requirement is confirmed instead by: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

B.

The test would be relevant: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. But the offered implementation—Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key.—addresses “Instantiate a module repeatedly with stable for_each keys”. The action needed here is: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

C.

This action/test pair addresses “Reference a local child module using an explicit filesystem source”. Declare a module block whose source is a reviewed local relative directory and pass the input values required by that reusable configuration. 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 case instead calls for: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

D.

Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Confirm it through this test: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

Question 486

A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root.
  2. Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key.
  3. Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.
  4. Set a reviewed version constraint for a registry module and upgrade intentionally after inspecting its release notes, interface and plan effects.

Answer & Explanations

Correct answer: C

A.

Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. This addresses “Expose child module results through outputs rather than internal assumptions”, where the governing principle is: Module outputs form an intentional interface, while the caller cannot reliably reference arbitrary nested resource attributes without such a contract. The stated case instead calls for: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

B.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key. This addresses “Instantiate a module repeatedly with stable for_each keys”, where the governing principle is: Repeated module blocks have keyed Terraform addresses and separate resource instance groups; removing one key need not reorder the remaining deployments. The stated case instead calls for: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

C.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership. Verify the result with this test: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

D.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. 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: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

Question 487

A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. The infrastructure engineer proposes this change: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Which mechanism explains why it works?

  1. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.
  2. Registry module version selection is independent of provider version selection, so a module release can change resources even if the provider lock remains unchanged.
  3. Module outputs form an intentional interface, while the caller cannot reliably reference arbitrary nested resource attributes without such a contract.
  4. Repeated module blocks have keyed Terraform addresses and separate resource instance groups; removing one key need not reorder the remaining deployments.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership. The corresponding implementation is: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

B.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. 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: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

C.

Module outputs form an intentional interface, while the caller cannot reliably reference arbitrary nested resource attributes without such a contract. That explains “Expose child module results through outputs rather than internal assumptions”, not the mechanism behind the described change. The relevant principle is: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

D.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Repeated module blocks have keyed Terraform addresses and separate resource instance groups; removing one key need not reorder the remaining deployments. That explains “Instantiate a module repeatedly with stable for_each keys”, not the mechanism behind the described change. The relevant principle is: Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

Question 488

A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. After implementing this change—Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.—which test most directly validates its intended outcome?

  1. Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error.
  2. Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.
  3. Initialize the same root module at two selected releases, inspect downloaded code and compare plans before authorizing an upgrade.
  4. Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable.

Answer & Explanations

Correct answer: B

A.

Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error. That would help test “Expose child module results through outputs rather than internal assumptions”, not the outcome required in this scenario. The relevant acceptance check is: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

B.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. This check is decisive because cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

C.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. 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: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

D.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable. That would help test “Instantiate a module repeatedly with stable for_each keys”, not the outcome required in this scenario. The relevant acceptance check is: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

Question 489

A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Which proposed shortcut most directly risks broken application connectivity after network replacement or environment migration and should therefore be rejected?

  1. Use positional count over a frequently reordered environment list and assume module instance identities are unaffected by inserting new entries.
  2. Refer directly from the root to a resource declared only inside a child module as if its nested address were a root resource name.
  3. Remove the module version argument and assume provider lock-file hashes freeze all module source changes automatically.
  4. Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Use positional count over a frequently reordered environment list and assume module instance identities are unaffected by inserting new entries. That shortcut risks unnecessary resource replacements from unstable repeated module addresses. Here the specific shortcut is: Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

B.

Refer directly from the root to a resource declared only inside a child module as if its nested address were a root resource name. That shortcut risks broken composition and accidental dependence on hidden internal module implementation. Here the specific shortcut is: Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

C.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. 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: Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module.

D.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Hardcode a cloud subnet ID inside an application module while claiming it automatically follows replacements performed by a separate networking module. The foreseeable failure is broken application connectivity after network replacement or environment migration. The safer response is: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

Question 490

A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Verify: Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable.
  2. Implement: Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. Verify: Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error.
  3. Implement: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Verify: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.
  4. Implement: Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key. Verify: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. The action is applicable: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. But its proposed test—Plan modules keyed by dev and qa, add a staging key and confirm the original module addresses remain stable.—addresses “Instantiate a module repeatedly with stable for_each keys”. This requirement is confirmed instead by: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output.

B.

This action/test pair addresses “Expose child module results through outputs rather than internal assumptions”. Define explicit outputs in a child module for resource IDs the caller needs, and reference them as module.<name>.<output> from the root. Apply a disposable child module, inspect the named output in the caller and confirm a missing output name produces a clear error. The case instead calls for: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

C.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs. Confirm it through this test: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. Cross-module expressions create Terraform dependency edges while preserving reusable, separately testable module implementations and clear ownership.

D.

The question is set in this situation: A city platform reuses a database module and compute module but needs explicit connections instead of manual copy-paste between them. The test would be relevant: Plan a disposable network-plus-app stack, inspect the dependency graph and confirm an app's input references the selected network output. But the offered implementation—Use module for_each over known stable environment keys to create independent instances, then address each module output by its map key.—addresses “Instantiate a module repeatedly with stable for_each keys”. The action needed here is: Call a network module and an application module from one root configuration, connecting only declared outputs to the dependent module's inputs.

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