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

Question 300

During a module implementation, one task is to obtain runtime-only data through an ephemeral provider operation, while another is to prevent credentials from entering source history. Select the matching pair of techniques.

  1. Use an ephemeral resource to retrieve supported temporary secrets + Treat saved plan files as sensitive artifacts
  2. Distinguish ephemeral from sensitive + Avoid committing secret .tfvars values
  3. Use an ephemeral resource to retrieve supported temporary secrets + Avoid committing secret .tfvars values
  4. Protect access to remote state + Use HCP Terraform sensitive workspace variables

Explanation

Correct Answer

C:

For the first criterion, ephemeral resources avoid persisting their results in Terraform's normal state and plan artifacts; their values cannot be used in arbitrary persistent resource fields; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history; this directly addresses the need to obtain runtime-only data through an ephemeral provider operation. For the separate second criterion, input files can contain plaintext and are often copied to laptops and CI systems; store sensitive values in a managed secret store or protected execution environment instead; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history; this fulfills the need to prevent credentials from entering source history. Together they cover the independent tasks of obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to obtain runtime-only data through an ephemeral provider operation, but its partner serves a different role: Binary plans can preserve configuration values and secrets; redaction in human-readable output does not make the saved plan safe to publish; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history. That second component is designed to avoid leaking inputs and backend information through CI downloads, so the still-missing criterion is to prevent credentials from entering source history, while the first criterion remains obtain runtime-only data through an ephemeral provider operation.

B:

The second measure does meet the prevent credentials from entering source history requirement, but the first is designed for another concern: Sensitive marks affect presentation; ephemeral marks constrain persistence and permitted expression contexts; they solve related but nonidentical problems; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history. That first component is designed to choose secrecy controls based on persistence as well as output redaction, which does not accomplish the requested task to obtain runtime-only data through an ephemeral provider operation, even though the other measure satisfies prevent credentials from entering source history.

D:

The first measure is intended to secure resource attributes and possibly persisted secrets: A remote backend may encrypt stored state and enforce access controls; terraform sensitive annotations do not replace backend security; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history. The second measure is intended to restrict display of secret input values in hosted runs: HCP Terraform offers marked-sensitive variables for workspace runs; their handling is a platform feature, not evidence that every resulting resource attribute is absent from state; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history. Neither is the directly designated method for the separate goals of obtain runtime-only data through an ephemeral provider operation and prevent credentials from entering source history in this review.

Question 301

A review finds confusion about resource versus data source behavior. The requirement is to ask Terraform to own the lifecycle of a remote object. Which Terraform mechanism directly meets this requirement?

  1. Declare a managed object with resource
  2. Reference aws_instance.web.id for a managed resource
  3. Understand data source failure on a missing object
  4. Distinguish locals from remote resource declarations
  5. Recognize terraform_data as a built-in managed resource

Explanation

Correct Answer

A:

A resource block is part of the desired managed infrastructure; terraform tracks its remote identity in state and may create, update, replace, or destroy it; this behavior should be assessed against the concrete need to ask Terraform to own the lifecycle of a remote object. This directly supports the task to ask Terraform to own the lifecycle of a remote object during an automated release.

Incorrect Answers

B:

A managed resource reference omits the data. prefix; terraform derives a dependency when an argument uses its computed attributes; this behavior should be assessed against the concrete need to ask Terraform to own the lifecycle of a remote object. That can be useful when the aim is to consume the ID of an object declared through a resource block, but it does not directly deliver the requested ability to ask Terraform to own the lifecycle of a remote object.

C:

Many provider data sources require a matching remote object and report an error when none exists; terraform does not create a replacement solely because the data block is present; this behavior should be assessed against the concrete need to ask Terraform to own the lifecycle of a remote object. The distinction matters here: using that mechanism to distinguish a failed lookup from a request to create the missing object would still leave the objective to ask Terraform to own the lifecycle of a remote object unmet.

D:

Local values are named expressions evaluated inside a module; they neither invoke resource creation nor bind a remote object into state; this behavior should be assessed against the concrete need to ask Terraform to own the lifecycle of a remote object. It may support a related workflow, but the question specifically requires the mechanism for ask Terraform to own the lifecycle of a remote object rather than compute reusable expression results without creating an API object.

E:

The built-in Terraform provider supplies this resource for lifecycle-oriented uses; it is not a general substitute for querying arbitrary cloud objects; this behavior should be assessed against the concrete need to ask Terraform to own the lifecycle of a remote object. The stated requirement is to ask Terraform to own the lifecycle of a remote object, not to store arbitrary values or trigger replacements without a third-party resource API; this alternative addresses a different control or phase.

Question 302

During a platform review, the team must accomplish all of these distinct aims: (1) collect an attribute from a list-like collection of resource instances; (2) prevent a graph in which objects depend on each other without a valid ordering; (3) create a stable boundary for modules that callers depend on. Select exactly the three relevant mechanisms. Choose THREE.

  1. Use data.type.name.attribute
  2. Avoid cyclic resource references
  3. Use output to expose child internals intentionally
  4. Use a for expression over a resource map
  5. Understand values unknown until apply
  6. Use resource.items[*].id for counted instances

Explanation

Correct Answers

B:

A circular dependency has no acyclic execution order; splitting responsibilities or breaking unnecessary references resolves the cycle; this behavior should be assessed against the concrete need to collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. This matches the distinct objective to prevent a graph in which objects depend on each other without a valid ordering; the remaining chosen features address collect an attribute from a list-like collection of resource instances and create a stable boundary for modules that callers depend on.

C:

An output value makes selected internal attributes available as module.name.output; child resources themselves remain encapsulated behind the module boundary; this behavior should be assessed against the concrete need to collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. This matches the distinct objective to create a stable boundary for modules that callers depend on; the remaining chosen features address collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering.

F:

Splat expressions iterate list, set, or tuple values, including count-created instances. for_each maps are normally traversed using a for expression; this behavior should be assessed against the concrete need to collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. This matches the distinct objective to collect an attribute from a list-like collection of resource instances; the remaining chosen features address prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on.

Incorrect Answers

A:

The data. prefix selects a read-only lookup namespace; without the prefix Terraform would interpret the address as a managed resource; this behavior should be assessed against the concrete need to collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. Its main application is to retrieve an attribute of a declared data source; the checklist instead asks for collect an attribute from a list-like collection of resource instances; and prevent a graph in which objects depend on each other without a valid ordering; and create a stable boundary for modules that callers depend on. None of those distinct criteria specifically calls for this alternative.

D:

A map-oriented expression can iterate keys and values to build a list or map; a legacy list-style splat is not the right accessor for a for_each resource map; this behavior should be assessed against the concrete need to collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. Its main application is to extract values from instances created with for_each; the checklist instead asks for collect an attribute from a list-like collection of resource instances; and prevent a graph in which objects depend on each other without a valid ordering; and create a stable boundary for modules that callers depend on. None of those distinct criteria specifically calls for this alternative.

E:

Terraform can propagate unknown values through expressions and defer dependent evaluations; unknown does not necessarily mean the configuration is invalid; this behavior should be assessed against the concrete need to collect an attribute from a list-like collection of resource instances and prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. Its main application is to avoid assuming every computed attribute is fixed during planning; the checklist instead asks for collect an attribute from a list-like collection of resource instances; and prevent a graph in which objects depend on each other without a valid ordering; and create a stable boundary for modules that callers depend on. None of those distinct criteria specifically calls for this alternative.

Question 303

A reviewer has to approve a two-part design: enforce the expected shape of a module input; additionally, supply a fallback when the caller omits the variable. Which option pairs the correct mechanisms?

  1. Declare variable "name" with a type constraint + Define output for a root result
  2. Pass values through -var-file=custom.tfvars + Set default for an optional configuration input
  3. Declare variable "name" with a type constraint + Set default for an optional configuration input
  4. Use TF_VAR_name environment variables + Set default for an optional configuration input
  5. Mark a sensitive output sensitive = true + Use terraform.tfvars or *.auto.tfvars

Explanation

Correct Answer

C:

For the first criterion, input types such as string, list(string), or object(...) describe accepted values; terraform checks the supplied value against this contract; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable; this directly addresses the need to enforce the expected shape of a module input. For the separate second criterion, a default provides a value without per-run input; a caller can still override it using a supported variable assignment mechanism; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable; this fulfills the need to supply a fallback when the caller omits the variable. Together they cover the independent tasks of enforce the expected shape of a module input and supply a fallback when the caller omits the variable without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to enforce the expected shape of a module input, but its partner serves a different role: Outputs provide a documented interface for command output and automation; they can be inspected with terraform output when recorded in state; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable. That second component is designed to expose a selected computed value after provisioning, so the still-missing criterion is to supply a fallback when the caller omits the variable, while the first criterion remains enforce the expected shape of a module input.

B:

The second measure does meet the supply a fallback when the caller omits the variable requirement, but the first is designed for another concern: Explicit variable files let separate runs use separate configurations; the file supplies module inputs, not resource lifecycle commands; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable. That first component is designed to load named environment inputs that are not automatically discovered, which does not accomplish the requested task to enforce the expected shape of a module input, even though the other measure satisfies supply a fallback when the caller omits the variable.

D:

The second measure does meet the supply a fallback when the caller omits the variable requirement, but the first is designed for another concern: Terraform reads variables with the TF_VAR_ prefix, subject to other higher-precedence input sources; environment variables can still leak in logs or process environments; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable. That first component is designed to provide a root input value without writing it in a tfvars file, which does not accomplish the requested task to enforce the expected shape of a module input, even though the other measure satisfies supply a fallback when the caller omits the variable.

E:

The first measure is intended to avoid showing a secret output value in normal human-readable CLI displays: Sensitive outputs are redacted in typical CLI presentation but remain recoverable from state by authorized readers; a root output is not secure secret storage; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable. The second measure is intended to automatically load documented variable files in a root module: Terraform discovers these conventional names during CLI runs; arbitrarily named .tfvars files require explicit selection; this behavior should be assessed against the concrete need to enforce the expected shape of a module input and supply a fallback when the caller omits the variable. Neither is the directly designated method for the separate goals of enforce the expected shape of a module input and supply a fallback when the caller omits the variable in this review.

Question 304

In an automated release, the requested result is to permit values of varying shapes where a strict contract is impractical. What should the engineer select?

  1. Convert values with tolist(...)
  2. Use flatten(...) for nested lists
  3. Use optional(...) in object attributes
  4. Use map(string) for named string values
  5. Access a map with var.tags["owner"]
  6. Use type = any sparingly

Explanation

Correct Answer

F:

The any placeholder relaxes static expectations but sacrifices early type guarantees; most module interfaces benefit from a concrete type; this behavior should be assessed against the concrete need to permit values of varying shapes where a strict contract is impractical. This directly supports the task to permit values of varying shapes where a strict contract is impractical during a module implementation.

Incorrect Answers

A:

The conversion yields a list but an unordered source set may produce an arbitrary order; do not use it to promise stable positions for set elements; this behavior should be assessed against the concrete need to permit values of varying shapes where a strict contract is impractical. That can be useful when the aim is to produce a list value when a downstream expression requires list semantics, but it does not directly deliver the requested ability to permit values of varying shapes where a strict contract is impractical.

B:

Flatten recursively reduces nested list/tuple containers while preserving the flattened order; it does not merge map attributes; this behavior should be assessed against the concrete need to permit values of varying shapes where a strict contract is impractical. The distinction matters here: using that mechanism to collapse a list of lists into one sequence would still leave the objective to permit values of varying shapes where a strict contract is impractical unmet.

C:

Optional attributes let module callers omit selected fields and may provide defaults; they do not make unrelated required object attributes optional; this behavior should be assessed against the concrete need to permit values of varying shapes where a strict contract is impractical. It may support a related workflow, but the question specifically requires the mechanism for permit values of varying shapes where a strict contract is impractical rather than allow an object field to be omitted from a typed input.

D:

Maps provide a homogeneous value type and stable keys; they differ from lists, which are indexed by position; this behavior should be assessed against the concrete need to permit values of varying shapes where a strict contract is impractical. The stated requirement is to permit values of varying shapes where a strict contract is impractical, not to look up values by arbitrary string keys; this alternative addresses a different control or phase.

E:

Bracket indexing selects an entry by key; a numeric list index such as [0] is not a substitute for a map key; this behavior should be assessed against the concrete need to permit values of varying shapes where a strict contract is impractical. That can be useful when the aim is to read a string-keyed collection value, but it does not directly deliver the requested ability to permit values of varying shapes where a strict contract is impractical.

Question 305

An engineer needs to obtain existing UTF-8 file contents during expression evaluation as part of an automated release. Which option is the best fit?

  1. Use replace(text, old, new)
  2. Use file(path) to read local text
  3. Use try(expr, fallback)
  4. Use a dynamic block to generate nested blocks

Explanation

Correct Answer

B:

File reads files present when evaluation starts; it is not a dependency-aware way to read a file that a resource will create during apply; this behavior should be assessed against the concrete need to obtain existing UTF-8 file contents during expression evaluation. This directly supports the task to obtain existing UTF-8 file contents during expression evaluation during an infrastructure audit.

Incorrect Answers

A:

Replace performs value transformation during evaluation; it does not trigger replacement of a managed resource by itself; this behavior should be assessed against the concrete need to obtain existing UTF-8 file contents during expression evaluation. The stated requirement is to obtain existing UTF-8 file contents during expression evaluation, not to substitute matching text or patterns in a string; this alternative addresses a different control or phase.

C:

Try evaluates arguments until one succeeds; it should not mask known structural errors or replace explicit input validation; this behavior should be assessed against the concrete need to obtain existing UTF-8 file contents during expression evaluation. The distinction matters here: using that mechanism to recover from dynamic expression errors with an alternative result would still leave the objective to obtain existing UTF-8 file contents during expression evaluation unmet.

D:

Dynamic blocks create nested configuration blocks, not top-level resources or meta-argument blocks; iteration can use for_each inside the dynamic block; this behavior should be assessed against the concrete need to obtain existing UTF-8 file contents during expression evaluation. It may support a related workflow, but the question specifically requires the mechanism for obtain existing UTF-8 file contents during expression evaluation rather than repeat provider-specific nested blocks from a collection.

Question 306

An engineer is diagnosing unexpected resource ordering. The requirement is to fail a plan that would destroy the protected resource while its block remains. Which Terraform mechanism directly meets this requirement?

  1. Avoid a circular dependency graph
  2. Use ignore_changes = [tags]
  3. Recognize lifecycle arguments are evaluated early
  4. Use prevent_destroy = true on a configured resource

Explanation

Correct Answer

D:

This is a lifecycle safety check, not a remote deletion-protection feature; removing the resource block also removes the rule from consideration; this behavior should be assessed against the concrete need to fail a plan that would destroy the protected resource while its block remains. This directly supports the task to fail a plan that would destroy the protected resource while its block remains during a planned migration.

Incorrect Answers

A:

Terraform cannot schedule a true cycle in its directed acyclic graph; rearranging references or splitting resource responsibilities can remove the cycle; this behavior should be assessed against the concrete need to fail a plan that would destroy the protected resource while its block remains. It may support a related workflow, but the question specifically requires the mechanism for fail a plan that would destroy the protected resource while its block remains rather than break mutual dependencies that prevent Terraform from ordering operations.

B:

Ignore-changes permits another process to adjust specified fields without Terraform constantly reverting them; it does not ignore creation-time arguments; this behavior should be assessed against the concrete need to fail a plan that would destroy the protected resource while its block remains. The stated requirement is to fail a plan that would destroy the protected resource while its block remains, not to exclude selected post-creation attribute differences from update planning; this alternative addresses a different control or phase.

C:

These lifecycle settings shape the graph construction stage and typically require literal values; a runtime input cannot freely toggle them as ordinary arguments; this behavior should be assessed against the concrete need to fail a plan that would destroy the protected resource while its block remains. That can be useful when the aim is to avoid dynamic expressions for create_before_destroy and similar rules, but it does not directly deliver the requested ability to fail a plan that would destroy the protected resource while its block remains.

Question 307

An operator is choosing between variable validation and ongoing health checks. A reviewer must determine how to stop a deployment when a required assumption fails. Which action is the appropriate choice?

  1. Use variable validation for valid network prefixes
  2. Use can(regex(...)) in validation
  3. Use a precondition rather than a check for an unsafe prerequisite
  4. Use a resource precondition

Explanation

Correct Answer

C:

Blocking conditions are appropriate when continuing could create invalid infrastructure; a check block typically reports a warning and lets operations proceed; this behavior should be assessed against the concrete need to stop a deployment when a required assumption fails. This directly supports the task to stop a deployment when a required assumption fails during a cross-team handoff.

Incorrect Answers

A:

Functions like can(cidrhost(...)) can validate address-format assumptions; this is input correctness, distinct from connectivity tests of a deployed network; this behavior should be assessed against the concrete need to stop a deployment when a required assumption fails. The distinction matters here: using that mechanism to reject malformed or disallowed input before resource creation would still leave the objective to stop a deployment when a required assumption fails unmet.

B:

Regex can raise an error when no match exists; can converts that evaluability into a Boolean; it makes a precise input-validation rule possible; this behavior should be assessed against the concrete need to stop a deployment when a required assumption fails. It may support a related workflow, but the question specifically requires the mechanism for stop a deployment when a required assumption fails rather than test a string against a pattern without crashing on a nonmatch.

D:

A lifecycle precondition can inspect values needed for a safe operation; failure blocks proceeding instead of simply recording a health warning; this behavior should be assessed against the concrete need to stop a deployment when a required assumption fails. That can be useful when the aim is to verify an assumption before Terraform processes the target resource operation, but it does not directly deliver the requested ability to stop a deployment when a required assumption fails.

Question 308

The immediate Terraform task is to obtain runtime-only data through an ephemeral provider operation. Which method handles that task most directly?

  1. Use environment-based provider authentication when supported
  2. Use short-lived cloud identities for automation
  3. Use a provider-supported write-only argument
  4. Use an ephemeral resource to retrieve supported temporary secrets

Explanation

Correct Answer

D:

Ephemeral resources avoid persisting their results in Terraform's normal state and plan artifacts; their values cannot be used in arbitrary persistent resource fields; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation. This directly supports the task to obtain runtime-only data through an ephemeral provider operation during a platform review.

Incorrect Answers

A:

Many providers support environment variables or workload identity; this lowers credential exposure in source but still requires secure runtime injection; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation. That can be useful when the aim is to avoid embedding long-lived credentials in HCL provider blocks, but it does not directly deliver the requested ability to obtain runtime-only data through an ephemeral provider operation.

B:

Dynamic provider credentials or workload federation can issue bounded run-specific authorization; this limits blast radius while still requiring correct API permissions; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation. The distinction matters here: using that mechanism to reduce dependence on hardcoded long-lived API keys would still leave the objective to obtain runtime-only data through an ephemeral provider operation unmet.

C:

Write-only arguments exist only where the provider schema supports them; they are available in Terraform 1.11+, including the tested 1.12 release; this behavior should be assessed against the concrete need to obtain runtime-only data through an ephemeral provider operation. It may support a related workflow, but the question specifically requires the mechanism for obtain runtime-only data through an ephemeral provider operation rather than send a secret to a managed resource without storing its value in plan or state.

Question 309

An engineer is deciding whether Terraform should own an existing object. A reviewer must determine how to store arbitrary values or trigger replacements without a third-party resource API. Which action is the appropriate choice?

  1. Distinguish locals from remote resource declarations
  2. Keep a data lookup separate from a same-object managed declaration
  3. Recognize terraform_data as a built-in managed resource
  4. Read data sources during planning when inputs are known

Explanation

Correct Answer

C:

The built-in Terraform provider supplies this resource for lifecycle-oriented uses; it is not a general substitute for querying arbitrary cloud objects; this behavior should be assessed against the concrete need to store arbitrary values or trigger replacements without a third-party resource API. This directly supports the task to store arbitrary values or trigger replacements without a third-party resource API during a staged rollout.

Incorrect Answers

A:

Local values are named expressions evaluated inside a module; they neither invoke resource creation nor bind a remote object into state; this behavior should be assessed against the concrete need to store arbitrary values or trigger replacements without a third-party resource API. That can be useful when the aim is to compute reusable expression results without creating an API object, but it does not directly deliver the requested ability to store arbitrary values or trigger replacements without a third-party resource API.

B:

A data source can read attributes but does not change who owns the underlying object; managing and reading one object need careful dependency design to avoid deferred or inconsistent reads; this behavior should be assessed against the concrete need to store arbitrary values or trigger replacements without a third-party resource API. The distinction matters here: using that mechanism to avoid mistaking two views of one API object for independent resources would still leave the objective to store arbitrary values or trigger replacements without a third-party resource API unmet.

D:

Terraform normally asks the provider to read data sources during a plan; reads may be deferred when inputs or dependent changes are not yet known; this behavior should be assessed against the concrete need to store arbitrary values or trigger replacements without a third-party resource API. The stated requirement is to store arbitrary values or trigger replacements without a third-party resource API, not to retrieve remote information for evaluating the proposed change; this alternative addresses a different control or phase.

Question 310

A reviewer has to approve a two-part design: prevent a graph in which objects depend on each other without a valid ordering; additionally, create a stable boundary for modules that callers depend on. Which option pairs the correct mechanisms?

  1. Use depends_on for hidden ordering requirements + Use output to expose child internals intentionally
  2. Avoid cyclic resource references + Use output to expose child internals intentionally
  3. Use data.type.name.attribute + Use module.network.subnet_id
  4. Use each.key in for_each blocks + Use output to expose child internals intentionally
  5. Avoid cyclic resource references + Use var.region

Explanation

Correct Answer

B:

For the first criterion, a circular dependency has no acyclic execution order; splitting responsibilities or breaking unnecessary references resolves the cycle; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on; this directly addresses the need to prevent a graph in which objects depend on each other without a valid ordering. For the separate second criterion, an output value makes selected internal attributes available as module.name.output; child resources themselves remain encapsulated behind the module boundary; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on; this fulfills the need to create a stable boundary for modules that callers depend on. Together they cover the independent tasks of prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on without exchanging the responsibilities of these features.

Incorrect Answers

A:

The second measure does meet the create a stable boundary for modules that callers depend on requirement, but the first is designed for another concern: Terraform's graph uses the explicit edge even without a data reference; overusing whole-resource dependencies may defer reads and reduce concurrency; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. That first component is designed to declare a relationship that cannot be expressed through an input attribute, which does not accomplish the requested task to prevent a graph in which objects depend on each other without a valid ordering, even though the other measure satisfies create a stable boundary for modules that callers depend on.

C:

The first measure is intended to retrieve an attribute of a declared data source: The data. prefix selects a read-only lookup namespace; without the prefix Terraform would interpret the address as a managed resource; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. The second measure is intended to consume a value explicitly exposed by a child module: A caller sees child-module outputs rather than arbitrary internal resources; the output also communicates dependencies and can serve as an interface contract; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. Neither is the directly designated method for the separate goals of prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on in this review.

D:

The second measure does meet the create a stable boundary for modules that callers depend on requirement, but the first is designed for another concern: Keys form instance addresses such as resource.name["blue"]; the key is not the same as a numeric count.index; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. That first component is designed to identify the stable key of the current map or set instance, which does not accomplish the requested task to prevent a graph in which objects depend on each other without a valid ordering, even though the other measure satisfies create a stable boundary for modules that callers depend on.

E:

The first measure meets the requirement to prevent a graph in which objects depend on each other without a valid ordering, but its partner serves a different role: The var. namespace refers to values supplied through the module's interface; it does not directly fetch provider configuration or remote state; this behavior should be assessed against the concrete need to prevent a graph in which objects depend on each other without a valid ordering and create a stable boundary for modules that callers depend on. That second component is designed to read a module input variable inside that module, so the still-missing criterion is to create a stable boundary for modules that callers depend on, while the first criterion remains prevent a graph in which objects depend on each other without a valid ordering.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests