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

Question 720

A reusable infrastructure definition has a concrete implementation goal: retrieve or generate temporary data that should not be persisted in Terraform state. What is the most appropriate Terraform mechanism?

  1. No secrets in version control
  2. Preventing credential leaks in plans
  3. An ephemeral resource block
  4. sensitive = true on an output
  5. HCP Terraform sensitive workspace variables

Explanation

Correct Answer

C:

Provider-supported ephemeral resources exist only during an operation and can feed appropriate ephemeral consumers; this directly meets the requirement to retrieve or generate temporary data that should not be persisted in Terraform state. By comparison, no secrets in version control is intended to keep API keys out of committed terraform.tfvars and .tf files, which is a different task from retrieve or generate temporary data that should not be persisted in Terraform state.

Incorrect Answers

A:

Secrets inserted directly into tracked configuration can leak through repository history, regardless of later state redaction; this mechanism is useful when the job is to keep API keys out of committed terraform.tfvars and .tf files, whereas the current scenario requires the engineer to retrieve or generate temporary data that should not be persisted in Terraform state. These operations have different effects in the stated Terraform workflow.

B:

Saved plan files may contain sensitive values and must be handled as confidential artifacts rather than safe public summaries; this mechanism is useful when the job is to avoid sharing a plan artifact publicly just because console values appear redacted, whereas the current scenario requires the engineer to retrieve or generate temporary data that should not be persisted in Terraform state. These operations have different effects in the stated Terraform workflow.

D:

A sensitive output is redacted in regular presentation, while JSON or raw output modes may reveal its value; this mechanism is useful when the job is to prevent a private output from appearing in normal human-readable CLI output, whereas the current scenario requires the engineer to retrieve or generate temporary data that should not be persisted in Terraform state. These operations have different effects in the stated Terraform workflow.

E:

HCP Terraform can mark workspace variables sensitive to limit UI exposure, though sensitive flags do not replace secure state access; this mechanism is useful when the job is to avoid exposing a secret in ordinary workspace variable screens and logs, whereas the current scenario requires the engineer to retrieve or generate temporary data that should not be persisted in Terraform state. These operations have different effects in the stated Terraform workflow.

Question 721

An operations team replacing ad-hoc scripts needs to apply the same validate-plan-apply lifecycle to more than one cloud. Which feature or operation is the most direct match?

  1. Integrating platform and DNS configuration
  2. Consistent automation pipeline
  3. Service-agnostic resource modeling
  4. Provider authentication per service

Explanation

Correct Answer

B:

Terraform's core workflow works across providers even though their individual resources and authentication methods differ; this directly meets the requirement to apply the same validate-plan-apply lifecycle to more than one cloud. By comparison, provider authentication per service is intended to authorize Terraform separately for two different infrastructure APIs, which is a different task from apply the same validate-plan-apply lifecycle to more than one cloud.

Incorrect Answers

A:

Distinct providers can manage compute and DNS resources while references communicate values such as an assigned endpoint; this mechanism is useful when the job is to manage a cloud-hosted service and its DNS records declaratively, whereas the current scenario requires the engineer to apply the same validate-plan-apply lifecycle to more than one cloud. These operations have different effects in the stated Terraform workflow.

C:

Terraform Core offers common configuration and state mechanisms while provider schemas capture each platform's API differences; this mechanism is useful when the job is to use a common configuration workflow across distinct vendors, whereas the current scenario requires the engineer to apply the same validate-plan-apply lifecycle to more than one cloud. These operations have different effects in the stated Terraform workflow.

D:

Each provider configuration supplies or discovers credentials appropriate to the API it calls, rather than sharing a universal Terraform credential; this mechanism is useful when the job is to authorize Terraform separately for two different infrastructure APIs, whereas the current scenario requires the engineer to apply the same validate-plan-apply lifecycle to more than one cloud. These operations have different effects in the stated Terraform workflow.

Question 722

A module publishing and release workflow requires a way to instantiate a reusable configuration unit under a distinct local name. Which Terraform approach most directly fulfills that request?

  1. Module composition
  2. Multiple calls to one module
  3. Avoiding hard-coded child credentials
  4. A module output reference
  5. A module call block

Explanation

Correct Answer

E:

The module block's source points to child configuration and its other arguments supply input variables and relevant meta-arguments; this directly meets the requirement to instantiate a reusable configuration unit under a distinct local name. By comparison, avoiding hard-coded child credentials is intended to keep authentication and deployment-specific region choices outside a reusable child module, which is a different task from instantiate a reusable configuration unit under a distinct local name.

Incorrect Answers

A:

Parent configurations can pass one child module's outputs into another child's inputs to compose larger infrastructure systems; this mechanism is useful when the job is to combine small modules into a root configuration without producing one giant module, whereas the current scenario requires the engineer to instantiate a reusable configuration unit under a distinct local name. These operations have different effects in the stated Terraform workflow.

B:

Two module blocks that use the same source create separate module instances and separate resource addresses; this mechanism is useful when the job is to deploy two independently managed stacks from the same module definition, whereas the current scenario requires the engineer to instantiate a reusable configuration unit under a distinct local name. These operations have different effects in the stated Terraform workflow.

C:

Reusable modules normally declare provider requirements while callers supply provider configurations and credentials; this mechanism is useful when the job is to keep authentication and deployment-specific region choices outside a reusable child module, whereas the current scenario requires the engineer to instantiate a reusable configuration unit under a distinct local name. These operations have different effects in the stated Terraform workflow.

D:

Module outputs provide explicit integration points between modules without relying on child resource addresses; this mechanism is useful when the job is to use a network module's subnet IDs inside an application module call, whereas the current scenario requires the engineer to instantiate a reusable configuration unit under a distinct local name. These operations have different effects in the stated Terraform workflow.

Question 723

During an infrastructure design review about how to check whether a collection contains a specific element, a maintainer asks what “The contains function” does. Which description is accurate?

  1. contains(collection, value) evaluates membership and returns a boolean.
  2. file reads existing local text; it does not wait for a provisioner to create the file during apply.
  3. format interpolates arguments into a printf-style string template for predictable names or identifiers.
  4. replace searches a string for a matching substring or pattern and replaces matches with a new string.

Explanation

Correct Answer

A:

The named mechanism is used when the objective is to check whether a collection contains a specific element, so it produces the behavior described. In contrast, the format function serves a different goal: build formatted text using placeholders for typed values, not check whether a collection contains a specific element.

Incorrect Answers

B:

The description applies to the file function when an engineer needs to read UTF-8 content already present in a local file during evaluation; the named the contains function instead handles the requirement to check whether a collection contains a specific element, so this behavior does not describe The contains function in the situation named.

C:

The description applies to the format function when an engineer needs to build formatted text using placeholders for typed values; the named the contains function instead handles the requirement to check whether a collection contains a specific element, so this behavior does not describe The contains function in the situation named.

D:

The description applies to the replace function when an engineer needs to substitute matching substrings within a value; the named the contains function instead handles the requirement to check whether a collection contains a specific element, so this behavior does not describe The contains function in the situation named.

Question 724

A team compares Terraform mechanisms for the goal to read an object from a secondary account rather than the default account. Which stated consequence belongs specifically to “Explicit provider selection on data blocks”?

  1. List both plugins under required_providers and configure each service's provider independently as needed.
  2. Non-default provider configurations must be passed explicitly to a child module instead of assuming aliases will propagate.
  3. Reusable child modules should primarily declare provider requirements and receive configurations from callers rather than embedding fixed credentials.
  4. A data block can set provider = aws.secondary to query through an alternate provider configuration.

Explanation

Correct Answer

D:

The named mechanism is used when the objective is to read an object from a secondary account rather than the default account, so it produces the behavior described. In contrast, separate required provider names serves a different goal: use two unrelated service APIs in one root configuration, not read an object from a secondary account rather than the default account.

Incorrect Answers

A:

The description applies to separate required provider names when an engineer needs to use two unrelated service APIs in one root configuration; the named explicit provider selection on data blocks instead handles the requirement to read an object from a secondary account rather than the default account, so this behavior does not describe Explicit provider selection on data blocks in the situation named.

B:

The description applies to no implicit child-module alias inheritance when an engineer needs to prevent a child module from silently using an unpassed alternate provider configuration; the named explicit provider selection on data blocks instead handles the requirement to read an object from a secondary account rather than the default account, so this behavior does not describe Explicit provider selection on data blocks in the situation named.

C:

The statement describes Provider configuration at the root, which is appropriate when engineers need to supply provider configurations from the root module to reusable child modules; it does not explain Explicit provider selection on data blocks, the construct used to read an object from a secondary account rather than the default account. The two behaviors are separate.

Question 725

A change request asks an engineer to limit ordinary display of a sensitive result exported from a reusable module. Which choice best implements the requested behavior?

  1. Nested module output propagation
  2. Input object variables
  3. Root input variable scope
  4. A variable default inside a child
  5. Child module outputs and sensitivity

Explanation

Correct Answer

E:

A child output can be marked sensitive, but its underlying value may still reside in state unless it uses permitted ephemeral handling; this directly meets the requirement to limit ordinary display of a sensitive result exported from a reusable module. By comparison, root input variable scope is intended to read command-line and tfvars input values for the root module, which is a different task from limit ordinary display of a sensitive result exported from a reusable module.

Incorrect Answers

A:

Each module boundary needs an output passthrough because the root cannot directly access an arbitrary grandchild's private resources; this mechanism is useful when the job is to make a value from a grandchild module visible to the root module, whereas the current scenario requires the engineer to limit ordinary display of a sensitive result exported from a reusable module. These operations have different effects in the stated Terraform workflow.

B:

An object type lets a module enforce named configuration fields instead of accepting many untyped values; this mechanism is useful when the job is to pass a structured settings bundle into a reusable module, whereas the current scenario requires the engineer to limit ordinary display of a sensitive result exported from a reusable module. These operations have different effects in the stated Terraform workflow.

C:

Root variables accept runtime assignments, whereas a child module normally receives its inputs through the parent's module call; this mechanism is useful when the job is to read command-line and tfvars input values for the root module, whereas the current scenario requires the engineer to limit ordinary display of a sensitive result exported from a reusable module. These operations have different effects in the stated Terraform workflow.

D:

A default inside the child variable declaration applies when the caller omits that module argument; this mechanism is useful when the job is to make a module input optional when callers do not require customization, whereas the current scenario requires the engineer to limit ordinary display of a sensitive result exported from a reusable module. These operations have different effects in the stated Terraform workflow.

Question 726

A platform team separating infrastructure deployments needs to start Terraform runs through an external automation integration. Which feature or operation is the most direct match?

  1. Workspace outputs
  2. A run apply phase
  3. A workspace variable
  4. An API-driven workspace

Explanation

Correct Answer

D:

HCP Terraform APIs can upload configuration versions and orchestrate runs programmatically; this directly meets the requirement to start Terraform runs through an external automation integration. By comparison, a workspace variable is intended to supply a configuration input or environment value for HCP Terraform runs, which is a different task from start Terraform runs through an external automation integration.

Incorrect Answers

A:

Workspace output values come from root module output blocks and can be consumed through supported interfaces; this mechanism is useful when the job is to publish selected values produced by an HCP Terraform run, whereas the current scenario requires the engineer to start Terraform runs through an external automation integration. These operations have different effects in the stated Terraform workflow.

B:

HCP Terraform can run the apply stage after its configured approval, policy and workflow requirements are satisfied; this mechanism is useful when the job is to execute approved resource changes within an HCP Terraform workspace, whereas the current scenario requires the engineer to start Terraform runs through an external automation integration. These operations have different effects in the stated Terraform workflow.

C:

HCP Terraform workspaces can hold Terraform input variables and environment variables for run-time use; this mechanism is useful when the job is to supply a configuration input or environment value for HCP Terraform runs, whereas the current scenario requires the engineer to start Terraform runs through an external automation integration. These operations have different effects in the stated Terraform workflow.

Question 727

An engineer intends to detect a mismatched plugin distribution package and is reviewing “Provider integrity hashes”. What consequence follows from using it as intended?

  1. A provider configuration with alias defines a named alternate that resources or modules can explicitly select.
  2. Terraform checks downloaded provider package checksums against lock information where hashes are available.
  3. Terraform generally selects the default provider matching a resource's type prefix unless an alternate configuration is specified.
  4. Providers implement resource and data-source schemas plus read, create, update and delete operations for their services.

Explanation

Correct Answer

B:

The named mechanism is used when the objective is to detect a mismatched plugin distribution package, so it produces the behavior described. In contrast, a provider plugin serves a different goal: translate Terraform resource operations into calls to the relevant remote API, not detect a mismatched plugin distribution package.

Incorrect Answers

A:

The description applies to provider aliases when an engineer needs to configure two connections to the same service for different regions or accounts; the named provider integrity hashes instead handles the requirement to detect a mismatched plugin distribution package, so this behavior does not describe Provider integrity hashes in the situation named.

C:

The description applies to implicit provider selection when an engineer needs to use the default provider configuration for a resource type; the named provider integrity hashes instead handles the requirement to detect a mismatched plugin distribution package, so this behavior does not describe Provider integrity hashes in the situation named.

D:

The description applies to a provider plugin when an engineer needs to translate Terraform resource operations into calls to the relevant remote API; the named provider integrity hashes instead handles the requirement to detect a mismatched plugin distribution package, so this behavior does not describe Provider integrity hashes in the situation named.

Question 728

During a design review, the requirement is to export a state snapshot from the configured backend for careful examination. Which option should the engineer select?

  1. terraform workspace select
  2. terraform state pull
  3. terraform show -json
  4. terraform providers

Explanation

Correct Answer

B:

State pull reads the current snapshot to standard output, including potentially sensitive provider attributes; this directly meets the requirement to export a state snapshot from the configured backend for careful examination. By comparison, terraform workspace select is intended to switch the currently selected Terraform CLI workspace, which is a different task from export a state snapshot from the configured backend for careful examination.

Incorrect Answers

A:

Workspace selection changes which workspace state namespace the root configuration uses; it does not select a cloud account automatically; this mechanism is useful when the job is to switch the currently selected Terraform CLI workspace, whereas the current scenario requires the engineer to export a state snapshot from the configured backend for careful examination. These operations have different effects in the stated Terraform workflow.

C:

The JSON representation supports automated inspection but must be protected because redacted display is not a security boundary; this mechanism is useful when the job is to read plan or state information in a structured representation, whereas the current scenario requires the engineer to export a state snapshot from the configured backend for careful examination. These operations have different effects in the stated Terraform workflow.

D:

The providers command displays provider requirements and their module relationships for dependency troubleshooting; this mechanism is useful when the job is to inspect which providers the current configuration requires, whereas the current scenario requires the engineer to export a state snapshot from the configured backend for careful examination. These operations have different effects in the stated Terraform workflow.

Question 729

A multi-provider deployment design requires a way to read information from an external service without owning its lifecycle. Which Terraform approach most directly fulfills that request?

  1. Implicit provider selection
  2. The provider registry namespace
  3. Provider-defined data sources
  4. Provider authentication environment variables

Explanation

Correct Answer

C:

A provider's data source reads existing data and exposes attributes without creating or destroying the queried object; this directly meets the requirement to read information from an external service without owning its lifecycle. By comparison, provider authentication environment variables is intended to avoid hard-coding a provider's API credential into .tf files, which is a different task from read information from an external service without owning its lifecycle.

Incorrect Answers

A:

Terraform generally selects the default provider matching a resource's type prefix unless an alternate configuration is specified; this mechanism is useful when the job is to use the default provider configuration for a resource type, whereas the current scenario requires the engineer to read information from an external service without owning its lifecycle. These operations have different effects in the stated Terraform workflow.

B:

The namespace portion of a source address separates provider publishers in the registry; this mechanism is useful when the job is to identify the publisher when providers share a type name, whereas the current scenario requires the engineer to read information from an external service without owning its lifecycle. These operations have different effects in the stated Terraform workflow.

D:

Many provider plugins can read credentials from provider-specific environment variables or identity mechanisms, reducing secret exposure in configuration; this mechanism is useful when the job is to avoid hard-coding a provider's API credential into .tf files, whereas the current scenario requires the engineer to read information from an external service without owning its lifecycle. These operations have different effects in the stated Terraform workflow.

Question 730

During a design review, the requirement is to prevent a developer with read access from automatically applying production changes. Which option should the engineer select?

  1. Drift detection in HCP Terraform
  2. Organization variable sets
  3. Workspace access separation
  4. HCP continuous validation

Explanation

Correct Answer

C:

HCP Terraform permissions differentiate viewing configuration and runs from authorized apply or administration operations; this directly meets the requirement to prevent a developer with read access from automatically applying production changes. By comparison, HCP continuous validation is intended to monitor whether infrastructure-specific check assertions still pass after deployment, which is a different task from prevent a developer with read access from automatically applying production changes.

Incorrect Answers

A:

HCP Terraform health features can detect changes made outside the workspace's managed Terraform workflow; this mechanism is useful when the job is to identify remote infrastructure deviations through scheduled or managed health assessments, whereas the current scenario requires the engineer to prevent a developer with read access from automatically applying production changes. These operations have different effects in the stated Terraform workflow.

B:

Variable sets let administrators manage common workspace variables centrally and scope them to intended workspaces or projects; this mechanism is useful when the job is to supply shared environment or Terraform input values across several workspaces, whereas the current scenario requires the engineer to prevent a developer with read access from automatically applying production changes. These operations have different effects in the stated Terraform workflow.

D:

Continuous validation can evaluate configuration check blocks to identify operational health issues in supported workspaces; this mechanism is useful when the job is to monitor whether infrastructure-specific check assertions still pass after deployment, whereas the current scenario requires the engineer to prevent a developer with read access from automatically applying production changes. These operations have different effects in the stated Terraform workflow.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests