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

Question 500

A reviewer has to approve a two-part design: catch incompatible caller values before deployment; additionally, connect two modules while preserving their separate scopes. Which option pairs the correct mechanisms?

  1. Use typed module inputs + Pass a root output through a child input explicitly
  2. Keep same-named child inputs separate across module calls + Avoid referencing child local values from the parent
  3. Use typed module inputs + Expose selected values via output blocks
  4. Use object inputs to bundle related options + Pass a root output through a child input explicitly

Explanation

Correct Answer

A:

For the first criterion, type constraints describe accepted strings, collections, or nested objects; they make the child-module contract more predictable than undocumented any values; this behavior should be assessed against the concrete need to catch incompatible caller values before deployment and connect two modules while preserving their separate scopes; this directly addresses the need to catch incompatible caller values before deployment. For the separate second criterion, a caller can use module.upstream.value as an argument to module.downstream; this also creates a dependency through the reference; this behavior should be assessed against the concrete need to catch incompatible caller values before deployment and connect two modules while preserving their separate scopes; this fulfills the need to connect two modules while preserving their separate scopes. Together they cover the independent tasks of catch incompatible caller values before deployment and connect two modules while preserving their separate scopes without exchanging the responsibilities of these features.

Incorrect Answers

B:

The first measure is intended to assign different values to identically named inputs in two distinct module instances: 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 catch incompatible caller values before deployment and connect two modules while preserving their separate scopes. The second measure is intended to preserve encapsulation of implementation-only calculations: 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 catch incompatible caller values before deployment and connect two modules while preserving their separate scopes. Neither is the directly designated method for the separate goals of catch incompatible caller values before deployment and connect two modules while preserving their separate scopes in this review.

C:

The first measure meets the requirement to catch incompatible caller values before deployment, but its partner serves a different role: A child output becomes accessible as module.instance.output_name; callers cannot directly reach arbitrary unexported resources inside the child module; this behavior should be assessed against the concrete need to catch incompatible caller values before deployment and connect two modules while preserving their separate scopes. That second component is designed to allow a caller to reference child results, so the still-missing criterion is to connect two modules while preserving their separate scopes, while the first criterion remains catch incompatible caller values before deployment.

D:

The second measure does meet the connect two modules while preserving their separate scopes requirement, but the first is designed for another concern: A typed object can describe several coherent settings at one interface boundary; nested data is still validated against the child's declared input contract; this behavior should be assessed against the concrete need to catch incompatible caller values before deployment and connect two modules while preserving their separate scopes. That first component is designed to reduce sprawling module argument lists while preserving type checking, which does not accomplish the requested task to catch incompatible caller values before deployment, even though the other measure satisfies connect two modules while preserving their separate scopes.

Question 501

In a planned migration, the requested result is to keep reusable components small and interoperable. What should the engineer select?

  1. Use depends_on on a module when necessary
  2. Use multiple child modules to separate responsibilities
  3. Define a module block with source
  4. Use a local module while iterating on a design

Explanation

Correct Answer

B:

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 keep reusable components small and interoperable. This directly supports the task to keep reusable components small and interoperable during a deployment checklist.

Incorrect Answers

A:

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 keep reusable components small and interoperable. The stated requirement is to keep reusable components small and interoperable, not to enforce a hidden prerequisite for an entire child module; this alternative addresses a different control or phase.

C:

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 keep reusable components small and interoperable. The distinction matters here: using that mechanism to instantiate a reusable child configuration from a known location would still leave the objective to keep reusable components small and interoperable unmet.

D:

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 keep reusable components small and interoperable. It may support a related workflow, but the question specifically requires the mechanism for keep reusable components small and interoperable rather than test in-repository child changes before publishing a version.

Question 502

A build pipeline compares module versioning across source types. The team must both refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages. Which paired choice implements those distinct goals?

  1. Do not assign a version argument to a local path module + Set version = "~> 2.3" on a registry module
  2. Use >= 1.2.0, < 2.0.0 for registry modules + Recognize module versions are not locked by .terraform.lock.hcl
  3. Treat major version changes as interface changes + Recognize module versions are not locked by .terraform.lock.hcl
  4. Use a release tag as a Git source ref + Document compatibility requirements for module consumers
  5. Use a release tag as a Git source ref + Recognize module versions are not locked by .terraform.lock.hcl

Explanation

Correct Answer

E:

For the first 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 refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages; this directly addresses the need to refer to a known Git module milestone. For the separate second criterion, the dependency lock file records provider versions and checksums; module selection is governed by source references and registry module constraints; this behavior should be assessed against the concrete need to refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages; this fulfills the need to avoid assuming the provider lock file pins downloaded module packages. Together they cover the independent tasks of refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to recognize that filesystem modules follow the current checkout: Local source content is taken directly from disk; versioning needs repository practices rather than Terraform's registry-module version selector; this behavior should be assessed against the concrete need to refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages. The second 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 refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages. Neither is the directly designated method for the separate goals of refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages in this review.

B:

The second measure does meet the avoid assuming the provider lock file pins downloaded module packages requirement, but the first is designed for another concern: 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 refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages. That first component is designed to permit a defined compatible interval of releases, which does not accomplish the requested task to refer to a known Git module milestone, even though the other measure satisfies avoid assuming the provider lock file pins downloaded module packages.

C:

The second measure does meet the avoid assuming the provider lock file pins downloaded module packages 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 refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages. That first component is designed to review module inputs, outputs, and resource movements before upgrading, which does not accomplish the requested task to refer to a known Git module milestone, even though the other measure satisfies avoid assuming the provider lock file pins downloaded module packages.

D:

The first measure meets the requirement to refer to a known Git module milestone, but its partner serves a different role: A reusable module can state minimum provider versions and tested Terraform versions; this keeps consumers from resolving unsupported combinations; this behavior should be assessed against the concrete need to refer to a known Git module milestone and avoid assuming the provider lock file pins downloaded module packages. That second component is designed to make dependency expectations explicit before broad reuse, so the still-missing criterion is to avoid assuming the provider lock file pins downloaded module packages, while the first criterion remains refer to a known Git module milestone.

Question 503

During a module implementation, the team must accomplish all of these distinct aims: (1) load a child module from a path relative to the calling configuration; (2) reuse a module from a sibling directory. Select exactly the two relevant mechanisms. Choose TWO.

  1. Use the module registry's documented inputs and outputs
  2. Use source = "./modules/network"
  3. Use a public registry source namespace/name/provider
  4. Avoid confusing a module with a provider
  5. Use source = "../shared"

Explanation

Correct Answers

B:

Local sources refer to code on disk, and ./ makes the relative location explicit; they do not select a published registry version; this behavior should be assessed against the concrete need to load a child module from a path relative to the calling configuration and reuse a module from a sibling directory. This matches the distinct objective to load a child module from a path relative to the calling configuration; the remaining chosen features address reuse a module from a sibling directory.

E:

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 load a child module from a path relative to the calling configuration and reuse a module from a sibling directory. This matches the distinct objective to reuse a module from a sibling directory; the remaining chosen features address load a child module from a path relative to the calling configuration.

Incorrect Answers

A:

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 load a child module from a path relative to the calling configuration and reuse a module from a sibling directory. Its main application is to integrate the module without assuming internal resource names are its API; the checklist instead asks for load a child module from a path relative to the calling configuration; and reuse a module from a sibling directory. None of those distinct criteria specifically calls for this alternative.

C:

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 load a child module from a path relative to the calling configuration and reuse a module from a sibling directory. Its main application is to retrieve a published module from its registry address; the checklist instead asks for load a child module from a path relative to the calling configuration; and reuse a module from a sibling directory. None of those distinct criteria specifically calls for this alternative.

D:

A module contains HCL blocks; a provider implements external API operations; an external module may use providers but is not itself a provider binary; this behavior should be assessed against the concrete need to load a child module from a path relative to the calling configuration and reuse a module from a sibling directory. Its main application is to recognize reusable Terraform configuration versus an API integration plugin; the checklist instead asks for load a child module from a path relative to the calling configuration; and reuse a module from a sibling directory. None of those distinct criteria specifically calls for this alternative.

Question 504

A Terraform rollout has separate acceptance criteria: connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking. Which combined approach directly satisfies the two criteria?

  1. Treat module output sensitivity as contagious + Keep same-named child inputs separate across module calls
  2. Pass a root output through a child input explicitly + Expose selected values via output blocks
  3. Pass a root output through a child input explicitly + Use object inputs to bundle related options
  4. Use a default on a child input for optional behavior + Use object inputs to bundle related options

Explanation

Correct Answer

C:

For the first criterion, a caller can use module.upstream.value as an argument to module.downstream; this also creates a dependency through the reference; this behavior should be assessed against the concrete need to connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking; this directly addresses the need to connect two modules while preserving their separate scopes. For the separate second criterion, a typed object can describe several coherent settings at one interface boundary; nested data is still validated against the child's declared input contract; this behavior should be assessed against the concrete need to connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking; this fulfills the need to reduce sprawling module argument lists while preserving type checking. Together they cover the independent tasks of connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to avoid accidentally publishing a secret through the caller's outputs: 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 connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking. The second measure is intended to assign different values to identically named inputs in two distinct module instances: 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 connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking. Neither is the directly designated method for the separate goals of connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking in this review.

B:

The first measure meets the requirement to connect two modules while preserving their separate scopes, but its partner serves a different role: A child output becomes accessible as module.instance.output_name; callers cannot directly reach arbitrary unexported resources inside the child module; this behavior should be assessed against the concrete need to connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking. That second component is designed to allow a caller to reference child results, so the still-missing criterion is to reduce sprawling module argument lists while preserving type checking, while the first criterion remains connect two modules while preserving their separate scopes.

D:

The second measure does meet the reduce sprawling module argument lists while preserving type checking requirement, but the first is designed for another concern: A variable default supplies the value within the child when no argument is passed; other child inputs without defaults remain required; this behavior should be assessed against the concrete need to connect two modules while preserving their separate scopes and reduce sprawling module argument lists while preserving type checking. That first component is designed to allow callers to omit that specific module argument, which does not accomplish the requested task to connect two modules while preserving their separate scopes, even though the other measure satisfies reduce sprawling module argument lists while preserving type checking.

Question 505

An engineer wants to instantiate multiple copies of a component. The team must both compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child. Which paired choice implements those distinct goals?

  1. Use a local module while iterating on a design + Share provider configurations from the root
  2. Build a root orchestration module + Share provider configurations from the root
  3. Build a root orchestration module + Use for_each on a compatible module call
  4. Supply required module input arguments + Use depends_on on a module when necessary

Explanation

Correct Answer

B:

For the first criterion, 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 compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child; this directly addresses the need to compose specialized children without embedding infrastructure logic everywhere. For the separate second criterion, 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 compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child; this fulfills the need to avoid configuring cloud credentials separately in every reusable child. Together they cover the independent tasks of compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the avoid configuring cloud credentials separately in every reusable child 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 compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child. That first component is designed to test in-repository child changes before publishing a version, which does not accomplish the requested task to compose specialized children without embedding infrastructure logic everywhere, even though the other measure satisfies avoid configuring cloud credentials separately in every reusable child.

C:

The first measure meets the requirement to compose specialized children without embedding infrastructure logic everywhere, 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 compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child. That second component is designed to instantiate a module per stable map or set key, so the still-missing criterion is to avoid configuring cloud credentials separately in every reusable child, while the first criterion remains compose specialized children without embedding infrastructure logic everywhere.

D:

The first 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 compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child. The second measure is intended to enforce a hidden prerequisite for an entire child module: 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 compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child. Neither is the directly designated method for the separate goals of compose specialized children without embedding infrastructure logic everywhere and avoid configuring cloud credentials separately in every reusable child in this review.

Question 506

A reusable module is receiving controlled releases. The requirement is to avoid assuming the provider lock file pins downloaded module packages. Which Terraform mechanism directly meets this requirement?

  1. Document compatibility requirements for module consumers
  2. Treat major version changes as interface changes
  3. Set version = "= 1.4.2" on a registry module
  4. Use a release tag as a Git source ref
  5. Recognize module versions are not locked by .terraform.lock.hcl

Explanation

Correct Answer

E:

The dependency lock file records provider versions and checksums; module selection is governed by source references and registry module constraints; this behavior should be assessed against the concrete need to avoid assuming the provider lock file pins downloaded module packages. This directly supports the task to avoid assuming the provider lock file pins downloaded module packages during an automated release.

Incorrect Answers

A:

A reusable module can state minimum provider versions and tested Terraform versions; this keeps consumers from resolving unsupported combinations; this behavior should be assessed against the concrete need to avoid assuming the provider lock file pins downloaded module packages. The stated requirement is to avoid assuming the provider lock file pins downloaded module packages, not to make dependency expectations explicit before broad reuse; this alternative addresses a different control or phase.

B:

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 avoid assuming the provider lock file pins downloaded module packages. That can be useful when the aim is to review module inputs, outputs, and resource movements before upgrading, but it does not directly deliver the requested ability to avoid assuming the provider lock file pins downloaded module packages.

C:

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 avoid assuming the provider lock file pins downloaded module packages. The distinction matters here: using that mechanism to use one exact published module version for reproducible runs would still leave the objective to avoid assuming the provider lock file pins downloaded module packages unmet.

D:

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 avoid assuming the provider lock file pins downloaded module packages. It may support a related workflow, but the question specifically requires the mechanism for avoid assuming the provider lock file pins downloaded module packages rather than refer to a known Git module milestone.

Question 507

A Terraform rollout has separate acceptance criteria: pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code. Which combined approach directly satisfies the two criteria?

  1. Use ?ref=v1.4.0 with a Git source + Run terraform init after adding an external module
  2. Use ?ref=v1.4.0 with a Git source + Understand source address is required for a module call
  3. Use git::https://... as the source + Use //subdirectory in an external module source
  4. Use source = "./modules/network" + Run terraform init after adding an external module

Explanation

Correct Answer

A:

For the first criterion, a Git ref selects code from the repository; for reproducibility a commit or immutable release tag is safer than a moving branch; this behavior should be assessed against the concrete need to pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code; this directly addresses the need to pin a Git-sourced module to a named tag, commit, or branch reference. For the separate second criterion, initialization retrieves remote modules and prepares the local working directory. terraform fmt cannot fetch source packages; this behavior should be assessed against the concrete need to pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code; this fulfills the need to download newly declared module source code. Together they cover the independent tasks of pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code without exchanging the responsibilities of these features.

Incorrect Answers

B:

The first measure meets the requirement to pin a Git-sourced module to a named tag, commit, or branch reference, but its partner serves a different role: 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 pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code. That second component is designed to identify where Terraform should load the child configuration, so the still-missing criterion is to download newly declared module source code, while the first criterion remains pin a Git-sourced module to a named tag, commit, or branch reference.

C:

The first measure is intended to fetch module code directly from a Git repository: Terraform supports a Git URL source and can use a reference query parameter; the registry version argument is not used to version raw Git sources; this behavior should be assessed against the concrete need to pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code. The second measure is intended to select a nested module directory inside a downloaded repository: 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 pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code. Neither is the directly designated method for the separate goals of pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code in this review.

D:

The second measure does meet the download newly declared module source code requirement, but the first is designed for another concern: Local sources refer to code on disk, and ./ makes the relative location explicit; they do not select a published registry version; this behavior should be assessed against the concrete need to pin a Git-sourced module to a named tag, commit, or branch reference and download newly declared module source code. That first component is designed to load a child module from a path relative to the calling configuration, which does not accomplish the requested task to pin a Git-sourced module to a named tag, commit, or branch reference, even though the other measure satisfies download newly declared module source code.

Question 508

A Terraform review separates 2 requirements: (1) accept values from the calling module through a documented interface; (2) allow a caller to reference child results. Identify the two features that each directly handle one of those requirements. Choose TWO.

  1. Use a default on a child input for optional behavior
  2. Declare inputs in a child variable block
  3. Expose selected values via output blocks
  4. Avoid referencing child local values from the parent
  5. Use typed module inputs
  6. Keep same-named child inputs separate across module calls

Explanation

Correct Answers

B:

Each module declares its own variable names and constraints; a child does not automatically inherit all root input variables; this behavior should be assessed against the concrete need to accept values from the calling module through a documented interface and allow a caller to reference child results. This matches the distinct objective to accept values from the calling module through a documented interface; the remaining chosen features address allow a caller to reference child results.

C:

A child output becomes accessible as module.instance.output_name; callers cannot directly reach arbitrary unexported resources inside the child module; this behavior should be assessed against the concrete need to accept values from the calling module through a documented interface and allow a caller to reference child results. This matches the distinct objective to allow a caller to reference child results; the remaining chosen features address accept values from the calling module through a documented interface.

Incorrect Answers

A:

A variable default supplies the value within the child when no argument is passed; other child inputs without defaults remain required; this behavior should be assessed against the concrete need to accept values from the calling module through a documented interface and allow a caller to reference child results. Its main application is to allow callers to omit that specific module argument; the checklist instead asks for accept values from the calling module through a documented interface; and allow a caller to reference child results. None of those distinct criteria specifically calls for this alternative.

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 accept values from the calling module through a documented interface and allow a caller to reference child results. Its main application is to preserve encapsulation of implementation-only calculations; the checklist instead asks for accept values from the calling module through a documented interface; and allow a caller to reference child results. None of those distinct criteria specifically calls for this alternative.

E:

Type constraints describe accepted strings, collections, or nested objects; they make the child-module contract more predictable than undocumented any values; this behavior should be assessed against the concrete need to accept values from the calling module through a documented interface and allow a caller to reference child results. Its main application is to catch incompatible caller values before deployment; the checklist instead asks for accept values from the calling module through a documented interface; and allow a caller to reference child results. None of those distinct criteria specifically calls for this alternative.

F:

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 accept values from the calling module through a documented interface and allow a caller to reference child results. Its main application is to assign different values to identically named inputs in two distinct module instances; the checklist instead asks for accept values from the calling module through a documented interface; and allow a caller to reference child results. None of those distinct criteria specifically calls for this alternative.

Question 509

During a cross-team handoff, the team must accomplish all of these distinct aims: (1) compose specialized children without embedding infrastructure logic everywhere; (2) avoid assuming a backend in a child controls the caller's state. Select exactly the two relevant mechanisms. Choose TWO.

  1. Define a module block with source
  2. Build a root orchestration module
  3. Use count on a compatible module call
  4. Share provider configurations from the root
  5. Keep backend configuration in the root module
  6. Read module.web.endpoint after declaring an output

Explanation

Correct Answers

B:

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 compose specialized children without embedding infrastructure logic everywhere and avoid assuming a backend in a child controls the caller's state. This matches the distinct objective to compose specialized children without embedding infrastructure logic everywhere; the remaining chosen features address avoid assuming a backend in a child controls the caller's state.

E:

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 compose specialized children without embedding infrastructure logic everywhere and avoid assuming a backend in a child controls the caller's state. This matches the distinct objective to avoid assuming a backend in a child controls the caller's state; the remaining chosen features address compose specialized children without embedding infrastructure logic everywhere.

Incorrect Answers

A:

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 compose specialized children without embedding infrastructure logic everywhere and avoid assuming a backend in a child controls the caller's state. Its main application is to instantiate a reusable child configuration from a known location; the checklist instead asks for compose specialized children without embedding infrastructure logic everywhere; and avoid assuming a backend in a child controls the caller's state. None of those distinct criteria specifically calls for this alternative.

C:

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 compose specialized children without embedding infrastructure logic everywhere and avoid assuming a backend in a child controls the caller's state. Its main application is to create a numbered collection of module instances; the checklist instead asks for compose specialized children without embedding infrastructure logic everywhere; and avoid assuming a backend in a child controls the caller's state. None of those distinct criteria specifically calls for this alternative.

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 compose specialized children without embedding infrastructure logic everywhere and avoid assuming a backend in a child controls the caller's state. Its main application is to avoid configuring cloud credentials separately in every reusable child; the checklist instead asks for compose specialized children without embedding infrastructure logic everywhere; and avoid assuming a backend in a child controls the caller's state. None of those distinct criteria specifically calls for this alternative.

F:

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 compose specialized children without embedding infrastructure logic everywhere and avoid assuming a backend in a child controls the caller's state. Its main application is to consume a child module result in the caller; the checklist instead asks for compose specialized children without embedding infrastructure logic everywhere; and avoid assuming a backend in a child controls the caller's state. None of those distinct criteria specifically calls for this alternative.

Question 510

During a deployment checklist, one task is to recognize that filesystem modules follow the current checkout, while another is to make dependency expectations explicit before broad reuse. Select the matching pair of techniques.

  1. Use a release tag as a Git source ref + Use >= 1.2.0, < 2.0.0 for registry modules
  2. Do not assign a version argument to a local path module + Review the plan after a module upgrade
  3. Specify a registry module version in the call + Document compatibility requirements for module consumers
  4. Set version = "= 1.4.2" on a registry module + Document compatibility requirements for module consumers
  5. Do not assign a version argument to a local path module + Document compatibility requirements for module consumers

Explanation

Correct Answer

E:

For the first criterion, local source content is taken directly from disk; versioning needs repository practices rather than Terraform's registry-module version selector; this behavior should be assessed against the concrete need to recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse; this directly addresses the need to recognize that filesystem modules follow the current checkout. For the separate second criterion, a reusable module can state minimum provider versions and tested Terraform versions; this keeps consumers from resolving unsupported combinations; this behavior should be assessed against the concrete need to recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse; this fulfills the need to make dependency expectations explicit before broad reuse. Together they cover the independent tasks of recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to refer to a known Git module milestone: 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 recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse. 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 recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse. Neither is the directly designated method for the separate goals of recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse in this review.

B:

The first measure meets the requirement to recognize that filesystem modules follow the current checkout, 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 recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse. That second component is designed to spot effects caused by changed child resource definitions, so the still-missing criterion is to make dependency expectations explicit before broad reuse, while the first criterion remains recognize that filesystem modules follow the current checkout.

C:

The second measure does meet the make dependency expectations explicit before broad reuse requirement, but the first is designed for another concern: 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 recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse. That first component is designed to distinguish registry version selection from source identification, which does not accomplish the requested task to recognize that filesystem modules follow the current checkout, even though the other measure satisfies make dependency expectations explicit before broad reuse.

D:

The second measure does meet the make dependency expectations explicit before broad reuse requirement, but the first is designed for another concern: 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 recognize that filesystem modules follow the current checkout and make dependency expectations explicit before broad reuse. That first component is designed to use one exact published module version for reproducible runs, which does not accomplish the requested task to recognize that filesystem modules follow the current checkout, even though the other measure satisfies make dependency expectations explicit before broad reuse.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests