HashiCorp Terraform Associate (HashiCorp Certified: Terraform Associate) Practice Test 57

Question 560

The immediate Terraform task is to reject a caller's explicit null rather than accidentally passing it onward. Which method handles that task most directly?

  1. Treat module output sensitivity as contagious
  2. Use nullable = false for a non-null module input
  3. Use child locals for internal derivations
  4. Avoid referencing child local values from the parent
  5. Keep same-named child inputs separate across module calls

Explanation

Correct Answer

B:

The variable setting controls whether null is permitted; it does not imply that the child can choose a cloud credential automatically; this behavior should be assessed against the concrete need to reject a caller's explicit null rather than accidentally passing it onward. This directly supports the task to reject a caller's explicit null rather than accidentally passing it onward during a configuration change.

Incorrect Answers

A:

Sensitive values can flow across module boundaries; a root output exposing a sensitive value generally needs an explicit sensitive marking; state protection remains necessary; this behavior should be assessed against the concrete need to reject a caller's explicit null rather than accidentally passing it onward. The stated requirement is to reject a caller's explicit null rather than accidentally passing it onward, not to avoid accidentally publishing a secret through the caller's outputs; this alternative addresses a different control or phase.

C:

Local values are not parameters the caller can set directly; they provide readable internal names for expressions derived from variables and resources; this behavior should be assessed against the concrete need to reject a caller's explicit null rather than accidentally passing it onward. The distinction matters here: using that mechanism to compute implementation details without exposing extra inputs would still leave the objective to reject a caller's explicit null rather than accidentally passing it onward unmet.

D:

Only outputs are exposed for general child-module consumption; callers should not depend on private local names that may change during refactoring; this behavior should be assessed against the concrete need to reject a caller's explicit null rather than accidentally passing it onward. It may support a related workflow, but the question specifically requires the mechanism for reject a caller's explicit null rather than accidentally passing it onward rather than preserve encapsulation of implementation-only calculations.

E:

Each call has its own variable namespace and argument values; passing region = "east" in one module call does not alter var.region inside another instance; this behavior should be assessed against the concrete need to reject a caller's explicit null rather than accidentally passing it onward. The stated requirement is to reject a caller's explicit null rather than accidentally passing it onward, not to assign different values to identically named inputs in two distinct module instances; this alternative addresses a different control or phase.

Question 561

A Terraform rollout has separate acceptance criteria: instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module. Which combined approach directly satisfies the two criteria?

  1. Use for_each on a compatible module call + Use depends_on on a module when necessary
  2. Use count on a compatible module call + Use depends_on on a module when necessary
  3. Use for_each on a compatible module call + Define a module block with source
  4. Use multiple child modules to separate responsibilities + Keep backend configuration in the root module

Explanation

Correct Answer

A:

For the first criterion, for-each instance addresses include keys and are often easier to maintain through membership changes than positional count indices; this behavior should be assessed against the concrete need to instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module; this directly addresses the need to instantiate a module per stable map or set key. For the separate second criterion, an explicit module dependency orders its operations after the listed object; prefer output references when they can express the dependency more narrowly; this behavior should be assessed against the concrete need to instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module; this fulfills the need to enforce a hidden prerequisite for an entire child module. Together they cover the independent tasks of instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module without exchanging the responsibilities of these features.

Incorrect Answers

B:

The second measure does meet the enforce a hidden prerequisite for an entire child module requirement, but the first is designed for another concern: Count produces addresses such as module.worker[0]; each instance can receive a different input computed from count.index; this behavior should be assessed against the concrete need to instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module. That first component is designed to create a numbered collection of module instances, which does not accomplish the requested task to instantiate a module per stable map or set key, even though the other measure satisfies enforce a hidden prerequisite for an entire child module.

C:

The first measure meets the requirement to instantiate a module per stable map or set key, but its partner serves a different role: A module call loads the child configuration and supplies its arguments; the caller's root remains responsible for backend setup; this behavior should be assessed against the concrete need to instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module. That second component is designed to instantiate a reusable child configuration from a known location, so the still-missing criterion is to enforce a hidden prerequisite for an entire child module, while the first criterion remains instantiate a module per stable map or set key.

D:

The first measure is intended to keep reusable components small and interoperable: Well-defined module outputs connect independent components without cloning all resource blocks; the overall run still uses one state for that root configuration; this behavior should be assessed against the concrete need to instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module. The second measure is intended to avoid assuming a backend in a child controls the caller's state: The backend applies to the top-level working configuration; child modules cannot independently select state storage during a normal shared module call; this behavior should be assessed against the concrete need to instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module. Neither is the directly designated method for the separate goals of instantiate a module per stable map or set key and enforce a hidden prerequisite for an entire child module in this review.

Question 562

A build pipeline compares module versioning across source types. The team must both choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases. Which paired choice implements those distinct goals?

  1. Set version = "~> 2.3" on a registry module + Use >= 1.2.0, < 2.0.0 for registry modules
  2. Use ?ref=COMMIT on a Git module + Review the plan after a module upgrade
  3. Treat major version changes as interface changes + Run terraform init -upgrade after changing a version range
  4. Use ?ref=COMMIT on a Git module + Run terraform init -upgrade after changing a version range

Explanation

Correct Answer

D:

For the first criterion, a commit hash identifies precise source content; module version arguments are not interpreted for raw Git sources; this behavior should be assessed against the concrete need to choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases; this directly addresses the need to choose a specific revision from an external Git repository. For the separate second criterion, upgrade mode re-fetches and reevaluates eligible dependencies; existing infrastructure does not change until a subsequent plan/apply; this behavior should be assessed against the concrete need to choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases; this fulfills the need to refresh external module and provider selections to newly permitted releases. Together they cover the independent tasks of choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to allow compatible registry releases within a bounded series: The pessimistic version constraint selects an eligible published release; it cannot pin raw Git URLs because that source uses its own reference mechanism; this behavior should be assessed against the concrete need to choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases. The second measure is intended to permit a defined compatible interval of releases: Multiple constraints are intersected when selecting registry module versions; they express an acceptable range, not a request to always use the latest major release; this behavior should be assessed against the concrete need to choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases. Neither is the directly designated method for the separate goals of choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases in this review.

B:

The first measure meets the requirement to choose a specific revision from an external Git repository, but its partner serves a different role: A new module may replace resources or alter defaults; initialization only fetches code; the plan reveals its likely infrastructure impact; this behavior should be assessed against the concrete need to choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases. That second component is designed to spot effects caused by changed child resource definitions, so the still-missing criterion is to refresh external module and provider selections to newly permitted releases, while the first criterion remains choose a specific revision from an external Git repository.

C:

The second measure does meet the refresh external module and provider selections to newly permitted releases requirement, but the first is designed for another concern: A new release can change the child module's contract or resource addresses; a valid installation does not guarantee a safe infrastructure plan; this behavior should be assessed against the concrete need to choose a specific revision from an external Git repository and refresh external module and provider selections to newly permitted releases. That first component is designed to review module inputs, outputs, and resource movements before upgrading, which does not accomplish the requested task to choose a specific revision from an external Git repository, even though the other measure satisfies refresh external module and provider selections to newly permitted releases.

Question 563

The immediate Terraform task is to identify where Terraform should load the child configuration. Which method handles that task most directly?

  1. Understand source address is required for a module call
  2. Use source = "../shared"
  3. Use //subdirectory in an external module source
  4. Use a public registry source namespace/name/provider
  5. Use the module registry's documented inputs and outputs

Explanation

Correct Answer

A:

The source argument resolves module code; a module block with no valid source cannot simply invent the child's resources; this behavior should be assessed against the concrete need to identify where Terraform should load the child configuration. This directly supports the task to identify where Terraform should load the child configuration during a configuration change.

Incorrect Answers

B:

Parent-relative local paths allow neighboring configurations to share code; the directory must be present on the machine or in the checked-out repository; this behavior should be assessed against the concrete need to identify where Terraform should load the child configuration. It may support a related workflow, but the question specifically requires the mechanism for identify where Terraform should load the child configuration rather than reuse a module from a sibling directory.

C:

The double-slash delimiter distinguishes the subdirectory from the package URL; terraform retrieves the containing package before entering the path; this behavior should be assessed against the concrete need to identify where Terraform should load the child configuration. The stated requirement is to identify where Terraform should load the child configuration, not to select a nested module directory inside a downloaded repository; this alternative addresses a different control or phase.

D:

The shorthand identifies a Terraform Registry module and its provider category; version constraints can apply to registry-sourced modules; this behavior should be assessed against the concrete need to identify where Terraform should load the child configuration. That can be useful when the aim is to retrieve a published module from its registry address, but it does not directly deliver the requested ability to identify where Terraform should load the child configuration.

E:

Published modules define an intended interface; callers supply declared variables and consume declared outputs; internal resources are implementation details; this behavior should be assessed against the concrete need to identify where Terraform should load the child configuration. The distinction matters here: using that mechanism to integrate the module without assuming internal resource names are its API would still leave the objective to identify where Terraform should load the child configuration unmet.

Question 564

An engineer needs to test in-repository child changes before publishing a version as part of an automated release. Which option is the best fit?

  1. Use a local module while iterating on a design
  2. Use count on a compatible module call
  3. Build a root orchestration module
  4. Share provider configurations from the root
  5. Use for_each on a compatible module call
  6. Define a module block with source

Explanation

Correct Answer

A:

A local path loads code directly from the checkout; this differs from upgrading an immutable release in an external module registry; this behavior should be assessed against the concrete need to test in-repository child changes before publishing a version. This directly supports the task to test in-repository child changes before publishing a version during an infrastructure audit.

Incorrect Answers

B:

Count produces addresses such as module.worker[0]; each instance can receive a different input computed from count.index; this behavior should be assessed against the concrete need to test in-repository child changes before publishing a version. That can be useful when the aim is to create a numbered collection of module instances, but it does not directly deliver the requested ability to test in-repository child changes before publishing a version.

C:

The root module can connect network, compute, and monitoring children through inputs and outputs; each child's encapsulation reduces repeated configuration; this behavior should be assessed against the concrete need to test in-repository child changes before publishing a version. The distinction matters here: using that mechanism to compose specialized children without embedding infrastructure logic everywhere would still leave the objective to test in-repository child changes before publishing a version unmet.

D:

A child module should declare provider requirements while receiving provider configurations through inheritance or explicit mapping; this supports flexible reuse; this behavior should be assessed against the concrete need to test in-repository child changes before publishing a version. It may support a related workflow, but the question specifically requires the mechanism for test in-repository child changes before publishing a version rather than avoid configuring cloud credentials separately in every reusable child.

E:

For-each instance addresses include keys and are often easier to maintain through membership changes than positional count indices; this behavior should be assessed against the concrete need to test in-repository child changes before publishing a version. The stated requirement is to test in-repository child changes before publishing a version, not to instantiate a module per stable map or set key; this alternative addresses a different control or phase.

F:

A module call loads the child configuration and supplies its arguments; the caller's root remains responsible for backend setup; this behavior should be assessed against the concrete need to test in-repository child changes before publishing a version. That can be useful when the aim is to instantiate a reusable child configuration from a known location, but it does not directly deliver the requested ability to test in-repository child changes before publishing a version.

Question 565

A reusable module is receiving controlled releases. Two independent changes are requested: first, permit a defined compatible interval of releases; second, refer to a known Git module milestone. Which pair of measures fulfills both?

  1. Use >= 1.2.0, < 2.0.0 for registry modules + Use a release tag as a Git source ref
  2. Set version = "~> 2.3" on a registry module + Use a release tag as a Git source ref
  3. Set version = "= 1.4.2" on a registry module + Specify a registry module version in the call
  4. Use >= 1.2.0, < 2.0.0 for registry modules + Run terraform init -upgrade after changing a version range

Explanation

Correct Answer

A:

For the first criterion, multiple constraints are intersected when selecting registry module versions; they express an acceptable range, not a request to always use the latest major release; this behavior should be assessed against the concrete need to permit a defined compatible interval of releases and refer to a known Git module milestone; this directly addresses the need to permit a defined compatible interval of releases. For the separate second criterion, a Git tag can name a release, but mutable tags remain a repository-governance risk; this version control is separate from registry module version constraints; this behavior should be assessed against the concrete need to permit a defined compatible interval of releases and refer to a known Git module milestone; this fulfills the need to refer to a known Git module milestone. Together they cover the independent tasks of permit a defined compatible interval of releases and refer to a known Git module milestone without exchanging the responsibilities of these features.

Incorrect Answers

B:

The second measure does meet the refer to a known Git module milestone requirement, but the first is designed for another concern: The pessimistic version constraint selects an eligible published release; it cannot pin raw Git URLs because that source uses its own reference mechanism; this behavior should be assessed against the concrete need to permit a defined compatible interval of releases and refer to a known Git module milestone. That first component is designed to allow compatible registry releases within a bounded series, which does not accomplish the requested task to permit a defined compatible interval of releases, even though the other measure satisfies refer to a known Git module milestone.

C:

The first measure is intended to use one exact published module version for reproducible runs: An equality constraint selects a specific registry release; it avoids accidental upgrades until the configuration is changed; this behavior should be assessed against the concrete need to permit a defined compatible interval of releases and refer to a known Git module milestone. The second measure is intended to distinguish registry version selection from source identification: The source says which module to fetch, while version constrains published versions; both are important for predictable registry consumption; this behavior should be assessed against the concrete need to permit a defined compatible interval of releases and refer to a known Git module milestone. Neither is the directly designated method for the separate goals of permit a defined compatible interval of releases and refer to a known Git module milestone in this review.

D:

The first measure meets the requirement to permit a defined compatible interval of releases, but its partner serves a different role: Upgrade mode re-fetches and reevaluates eligible dependencies; existing infrastructure does not change until a subsequent plan/apply; this behavior should be assessed against the concrete need to permit a defined compatible interval of releases and refer to a known Git module milestone. That second component is designed to refresh external module and provider selections to newly permitted releases, so the still-missing criterion is to refer to a known Git module milestone, while the first criterion remains permit a defined compatible interval of releases.

Question 566

A platform team is composing reusable modules into a root configuration. Two independent changes are requested: first, instantiate a reusable child configuration from a known location; second, consume a child module result in the caller. Which pair of measures fulfills both?

  1. Pass the providers mapping to a child + Read module.web.endpoint after declaring an output
  2. Define a module block with source + Read module.web.endpoint after declaring an output
  3. Keep backend configuration in the root module + Supply required module input arguments
  4. Define a module block with source + Use for_each on a compatible module call
  5. Use count on a compatible module call + Read module.web.endpoint after declaring an output
  6. Define a module block with source + Share provider configurations from the root

Explanation

Correct Answer

B:

For the first criterion, a module call loads the child configuration and supplies its arguments; the caller's root remains responsible for backend setup; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller; this directly addresses the need to instantiate a reusable child configuration from a known location. For the separate second criterion, only named output values are exposed by the module reference; the caller cannot assume internal resource addresses are directly visible; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller; this fulfills the need to consume a child module result in the caller. Together they cover the independent tasks of instantiate a reusable child configuration from a known location and consume a child module result in the caller without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the consume a child module result in the caller requirement, but the first is designed for another concern: A module provider map binds the child's expected names to configured parent provider instances; it does not install providers independently; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller. That first component is designed to select which root provider configurations the module uses, which does not accomplish the requested task to instantiate a reusable child configuration from a known location, even though the other measure satisfies consume a child module result in the caller.

C:

The first measure is intended to avoid assuming a backend in a child controls the caller's state: The backend applies to the top-level working configuration; child modules cannot independently select state storage during a normal shared module call; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller. The second measure is intended to meet the child module's variable contract: Terraform maps arguments by name to variables declared inside the child; missing required values prevent a valid plan; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller. Neither is the directly designated method for the separate goals of instantiate a reusable child configuration from a known location and consume a child module result in the caller in this review.

D:

The first measure meets the requirement to instantiate a reusable child configuration from a known location, but its partner serves a different role: For-each instance addresses include keys and are often easier to maintain through membership changes than positional count indices; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller. That second component is designed to instantiate a module per stable map or set key, so the still-missing criterion is to consume a child module result in the caller, while the first criterion remains instantiate a reusable child configuration from a known location.

E:

The second measure does meet the consume a child module result in the caller requirement, but the first is designed for another concern: Count produces addresses such as module.worker[0]; each instance can receive a different input computed from count.index; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller. That first component is designed to create a numbered collection of module instances, which does not accomplish the requested task to instantiate a reusable child configuration from a known location, even though the other measure satisfies consume a child module result in the caller.

F:

The first measure meets the requirement to instantiate a reusable child configuration from a known location, but its partner serves a different role: A child module should declare provider requirements while receiving provider configurations through inheritance or explicit mapping; this supports flexible reuse; this behavior should be assessed against the concrete need to instantiate a reusable child configuration from a known location and consume a child module result in the caller. That second component is designed to avoid configuring cloud credentials separately in every reusable child, so the still-missing criterion is to consume a child module result in the caller, while the first criterion remains instantiate a reusable child configuration from a known location.

Question 567

A module call requires provider settings and outputs. A reviewer must determine how to create a numbered collection of module instances. Which action is the appropriate choice?

  1. Read module.web.endpoint after declaring an output
  2. Define a module block with source
  3. Use for_each on a compatible module call
  4. Build a root orchestration module
  5. Use count on a compatible module call

Explanation

Correct Answer

E:

Count produces addresses such as module.worker[0]; each instance can receive a different input computed from count.index; this behavior should be assessed against the concrete need to create a numbered collection of module instances. This directly supports the task to create a numbered collection of module instances during a cross-team handoff.

Incorrect Answers

A:

Only named output values are exposed by the module reference; the caller cannot assume internal resource addresses are directly visible; this behavior should be assessed against the concrete need to create a numbered collection of module instances. The distinction matters here: using that mechanism to consume a child module result in the caller would still leave the objective to create a numbered collection of module instances unmet.

B:

A module call loads the child configuration and supplies its arguments; the caller's root remains responsible for backend setup; this behavior should be assessed against the concrete need to create a numbered collection of module instances. It may support a related workflow, but the question specifically requires the mechanism for create a numbered collection of module instances rather than instantiate a reusable child configuration from a known location.

C:

For-each instance addresses include keys and are often easier to maintain through membership changes than positional count indices; this behavior should be assessed against the concrete need to create a numbered collection of module instances. The stated requirement is to create a numbered collection of module instances, not to instantiate a module per stable map or set key; this alternative addresses a different control or phase.

D:

The root module can connect network, compute, and monitoring children through inputs and outputs; each child's encapsulation reduces repeated configuration; this behavior should be assessed against the concrete need to create a numbered collection of module instances. That can be useful when the aim is to compose specialized children without embedding infrastructure logic everywhere, but it does not directly deliver the requested ability to create a numbered collection of module instances.

Question 568

The immediate Terraform task is to select which root provider configurations the module uses. Which method handles that task most directly?

  1. Build a root orchestration module
  2. Keep backend configuration in the root module
  3. Supply required module input arguments
  4. Read module.web.endpoint after declaring an output
  5. Pass the providers mapping to a child

Explanation

Correct Answer

E:

A module provider map binds the child's expected names to configured parent provider instances; it does not install providers independently; this behavior should be assessed against the concrete need to select which root provider configurations the module uses. This directly supports the task to select which root provider configurations the module uses during a platform review.

Incorrect Answers

A:

The root module can connect network, compute, and monitoring children through inputs and outputs; each child's encapsulation reduces repeated configuration; this behavior should be assessed against the concrete need to select which root provider configurations the module uses. It may support a related workflow, but the question specifically requires the mechanism for select which root provider configurations the module uses rather than compose specialized children without embedding infrastructure logic everywhere.

B:

The backend applies to the top-level working configuration; child modules cannot independently select state storage during a normal shared module call; this behavior should be assessed against the concrete need to select which root provider configurations the module uses. The stated requirement is to select which root provider configurations the module uses, not to avoid assuming a backend in a child controls the caller's state; this alternative addresses a different control or phase.

C:

Terraform maps arguments by name to variables declared inside the child; missing required values prevent a valid plan; this behavior should be assessed against the concrete need to select which root provider configurations the module uses. That can be useful when the aim is to meet the child module's variable contract, but it does not directly deliver the requested ability to select which root provider configurations the module uses.

D:

Only named output values are exposed by the module reference; the caller cannot assume internal resource addresses are directly visible; this behavior should be assessed against the concrete need to select which root provider configurations the module uses. The distinction matters here: using that mechanism to consume a child module result in the caller would still leave the objective to select which root provider configurations the module uses unmet.

Question 569

A Terraform rollout has separate acceptance criteria: meet the child module's variable contract and create a numbered collection of module instances. Which combined approach directly satisfies the two criteria?

  1. Use for_each on a compatible module call + Use count on a compatible module call
  2. Supply required module input arguments + Use count on a compatible module call
  3. Read module.web.endpoint after declaring an output + Share provider configurations from the root
  4. Use a local module while iterating on a design + Use count on a compatible module call
  5. Supply required module input arguments + Build a root orchestration module

Explanation

Correct Answer

B:

For the first criterion, terraform maps arguments by name to variables declared inside the child; missing required values prevent a valid plan; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances; this directly addresses the need to meet the child module's variable contract. For the separate second criterion, count produces addresses such as module.worker[0]; each instance can receive a different input computed from count.index; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances; this fulfills the need to create a numbered collection of module instances. Together they cover the independent tasks of meet the child module's variable contract and create a numbered collection of module instances without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the create a numbered collection of module instances requirement, but the first is designed for another concern: For-each instance addresses include keys and are often easier to maintain through membership changes than positional count indices; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances. That first component is designed to instantiate a module per stable map or set key, which does not accomplish the requested task to meet the child module's variable contract, even though the other measure satisfies create a numbered collection of module instances.

C:

The first measure is intended to consume a child module result in the caller: Only named output values are exposed by the module reference; the caller cannot assume internal resource addresses are directly visible; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances. The second measure is intended to avoid configuring cloud credentials separately in every reusable child: A child module should declare provider requirements while receiving provider configurations through inheritance or explicit mapping; this supports flexible reuse; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances. Neither is the directly designated method for the separate goals of meet the child module's variable contract and create a numbered collection of module instances in this review.

D:

The second measure does meet the create a numbered collection of module instances requirement, but the first is designed for another concern: A local path loads code directly from the checkout; this differs from upgrading an immutable release in an external module registry; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances. That first component is designed to test in-repository child changes before publishing a version, which does not accomplish the requested task to meet the child module's variable contract, even though the other measure satisfies create a numbered collection of module instances.

E:

The first measure meets the requirement to meet the child module's variable contract, but its partner serves a different role: The root module can connect network, compute, and monitoring children through inputs and outputs; each child's encapsulation reduces repeated configuration; this behavior should be assessed against the concrete need to meet the child module's variable contract and create a numbered collection of module instances. That second component is designed to compose specialized children without embedding infrastructure logic everywhere, so the still-missing criterion is to create a numbered collection of module instances, while the first criterion remains meet the child module's variable contract.

Question 570

An engineer needs to enforce a hidden prerequisite for an entire child module as part of a planned migration. Which option is the best fit?

  1. Use a local module while iterating on a design
  2. Define a module block with source
  3. Use depends_on on a module when necessary
  4. Share provider configurations from the root
  5. Supply required module input arguments

Explanation

Correct Answer

C:

An explicit module dependency orders its operations after the listed object; prefer output references when they can express the dependency more narrowly; this behavior should be assessed against the concrete need to enforce a hidden prerequisite for an entire child module. This directly supports the task to enforce a hidden prerequisite for an entire child module during a maintenance request.

Incorrect Answers

A:

A local path loads code directly from the checkout; this differs from upgrading an immutable release in an external module registry; this behavior should be assessed against the concrete need to enforce a hidden prerequisite for an entire child module. That can be useful when the aim is to test in-repository child changes before publishing a version, but it does not directly deliver the requested ability to enforce a hidden prerequisite for an entire child module.

B:

A module call loads the child configuration and supplies its arguments; the caller's root remains responsible for backend setup; this behavior should be assessed against the concrete need to enforce a hidden prerequisite for an entire child module. The distinction matters here: using that mechanism to instantiate a reusable child configuration from a known location would still leave the objective to enforce a hidden prerequisite for an entire child module unmet.

D:

A child module should declare provider requirements while receiving provider configurations through inheritance or explicit mapping; this supports flexible reuse; this behavior should be assessed against the concrete need to enforce a hidden prerequisite for an entire child module. The stated requirement is to enforce a hidden prerequisite for an entire child module, not to avoid configuring cloud credentials separately in every reusable child; this alternative addresses a different control or phase.

E:

Terraform maps arguments by name to variables declared inside the child; missing required values prevent a valid plan; this behavior should be assessed against the concrete need to enforce a hidden prerequisite for an entire child module. That can be useful when the aim is to meet the child module's variable contract, but it does not directly deliver the requested ability to enforce a hidden prerequisite for an entire child module.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests