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

Question 790

A Terraform runbook prescribes “TF_LOG_CORE” to save enabled Terraform diagnostic logs to a designated file, but it does not meet the requirement. What does that step actually accomplish?

  1. High verbosity creates large logs and greater secret-exposure risk; enable it for a specific incident and disable it afterward.
  2. Unsetting or disabling Terraform's TF_LOG environment setting removes extra diagnostic verbosity from later commands.
  3. TF_LOG_PATH directs log output to a file and should be combined with an enabled TF_LOG level.
  4. The TF_LOG_CORE variable can control log verbosity for Core messages independently of general logging.

Explanation

Correct Answer

D:

TF_LOG_CORE is used when an operator needs to focus verbose diagnostics on Terraform Core rather than all plugin activity. Consequently, this choice cannot meet the separate requirement to save enabled Terraform diagnostic logs to a designated file. The intended action would instead require TF_LOG_PATH.

Incorrect Answers

A:

This behavior belongs to Verbose logging only during diagnosis, which helps engineers avoid permanent trace logs in normal automated runs rather than satisfying the separate requirement to save enabled Terraform diagnostic logs to a designated file. The attempted technique was TF_LOG_CORE; it would instead be used to focus verbose diagnostics on Terraform Core rather than all plugin activity, not to produce the effect associated with Verbose logging only during diagnosis.

B:

This behavior belongs to Disabling TF_LOG, which helps engineers return a shell session to ordinary Terraform logging after investigation rather than satisfying the separate requirement to save enabled Terraform diagnostic logs to a designated file. The attempted technique was TF_LOG_CORE; it would instead be used to focus verbose diagnostics on Terraform Core rather than all plugin activity, not to produce the effect associated with Disabling TF_LOG.

C:

That outcome belongs to TF_LOG_PATH, the mechanism that can save enabled Terraform diagnostic logs to a designated file. The question concerns the engineer’s actual proposal, TF_LOG_CORE; it is directed at focus verbose diagnostics on Terraform Core rather than all plugin activity, not that result.

Question 791

An engineering checklist calls for separate outcomes: (1) categorize HCP Terraform workspaces for filtering or configuration selection; (2) run Terraform in a private network where hosted workers cannot reach internal endpoints. Which TWO options implement the requested outcomes? Choose TWO.

  1. HCP Terraform execution agents
  2. A VCS-connected workspace
  3. HCP Terraform run triggers between workspaces
  4. Workspace tags
  5. Project membership changes

Explanation

Correct Answers

A:

HCP Terraform agents can execute runs in customer-controlled networking while integrating with service orchestration; this meets the requirement to run Terraform in a private network where hosted workers cannot reach internal endpoints, while the other selected techniques address categorize HCP Terraform workspaces for filtering or configuration selection, which require their own distinct Terraform mechanisms.

D:

Workspace tags help group and select workspaces, including when a CLI cloud block targets tagged workspace sets; this meets the requirement to categorize HCP Terraform workspaces for filtering or configuration selection, while the other selected techniques address run Terraform in a private network where hosted workers cannot reach internal endpoints, which require their own distinct Terraform mechanisms.

Incorrect Answers

B:

HCP Terraform can connect a workspace to a VCS repository and create runs when relevant commits are pushed; it addresses trigger infrastructure runs from changes in a configured version-control repository, but this delivery instead requires categorize HCP Terraform workspaces for filtering or configuration selection and run Terraform in a private network where hosted workers cannot reach internal endpoints. The required combination involves HCP Terraform execution agents and Workspace tags, not the behavior of A VCS-connected workspace.

C:

A run trigger can initiate a downstream plan when its designated upstream workspace completes the relevant run; it addresses coordinate a dependent app deployment following an upstream network workspace apply, but this delivery instead requires categorize HCP Terraform workspaces for filtering or configuration selection and run Terraform in a private network where hosted workers cannot reach internal endpoints. The required combination involves HCP Terraform execution agents and Workspace tags, not the behavior of HCP Terraform run triggers between workspaces.

E:

A project is a grouping and access construct; changing project assignment does not turn two workspaces into one state; it addresses move a workspace to a different organizational group without merging infrastructure state, but this delivery instead requires categorize HCP Terraform workspaces for filtering or configuration selection and run Terraform in a private network where hosted workers cannot reach internal endpoints. The required combination involves HCP Terraform execution agents and Workspace tags, not the behavior of Project membership changes.

Question 792

A change request asks an engineer to make a value from a grandchild module visible to the root module. Which choice best implements the requested behavior?

  1. Different values for two module calls
  2. Nested module output propagation
  3. Input object variables
  4. Parent-to-child argument passing

Explanation

Correct Answer

B:

Each module boundary needs an output passthrough because the root cannot directly access an arbitrary grandchild's private resources; this directly meets the requirement to make a value from a grandchild module visible to the root module. By comparison, different values for two module calls is intended to instantiate the same module with distinct environment inputs, which is a different task from make a value from a grandchild module visible to the root module.

Incorrect Answers

A:

Each call has its own variable assignments and resource instances, even when both calls reference the same module source directory; this mechanism is useful when the job is to instantiate the same module with distinct environment inputs, whereas the current scenario requires the engineer to make a value from a grandchild module visible to the root module. These operations have different effects in the stated Terraform workflow.

C:

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 make a value from a grandchild module visible to the root module. These operations have different effects in the stated Terraform workflow.

D:

A module block explicitly sets the child's declared input variables using arguments of matching names; this mechanism is useful when the job is to set a reusable module's environment tag from the caller, whereas the current scenario requires the engineer to make a value from a grandchild module visible to the root module. These operations have different effects in the stated Terraform workflow.

Question 793

A Terraform runbook prescribes “A major-series compatible constraint” to declare where a provider plugin comes from and which versions are acceptable, but it does not meet the requirement. What does that step actually accomplish?

  1. A CLI provider_installation configuration can direct provider package discovery to a network or filesystem mirror.
  2. The -upgrade switch permits newer versions that satisfy constraints instead of preserving current installed or locked selections.
  3. A required_providers entry maps a local provider name to its source address and version constraint; it does not configure API credentials.
  4. The pessimistic constraint ~> 5.3 permits version 5.3 and later releases below 6.0.0.

Explanation

Correct Answer

D:

A major-series compatible constraint is used when an operator needs to accept minor and patch updates without crossing the next major version. Consequently, this choice cannot meet the separate requirement to declare where a provider plugin comes from and which versions are acceptable. The intended action would instead require The required_providers block.

Incorrect Answers

A:

This behavior belongs to A provider mirror, which helps engineers install approved plugins from an internal distribution location rather than satisfying the separate requirement to declare where a provider plugin comes from and which versions are acceptable. The attempted technique was A major-series compatible constraint; it would instead be used to accept minor and patch updates without crossing the next major version, not to produce the effect associated with A provider mirror.

B:

This behavior belongs to terraform init -upgrade, which helps engineers intentionally reconsider previously locked provider and module selections rather than satisfying the separate requirement to declare where a provider plugin comes from and which versions are acceptable. The attempted technique was A major-series compatible constraint; it would instead be used to accept minor and patch updates without crossing the next major version, not to produce the effect associated with terraform init -upgrade.

C:

That outcome belongs to The required_providers block, the mechanism that can declare where a provider plugin comes from and which versions are acceptable. The question concerns the engineer’s actual proposal, A major-series compatible constraint; it is directed at accept minor and patch updates without crossing the next major version, not that result.

Question 794

During a design review, the requirement is to instantiate the same module with distinct environment inputs. Which option should the engineer select?

  1. Different values for two module calls
  2. Child module outputs and sensitivity
  3. Child input variable scope
  4. A variable default inside a child

Explanation

Correct Answer

A:

Each call has its own variable assignments and resource instances, even when both calls reference the same module source directory; this directly meets the requirement to instantiate the same module with distinct environment inputs. By comparison, child module outputs and sensitivity is intended to limit ordinary display of a sensitive result exported from a reusable module, which is a different task from instantiate the same module with distinct environment inputs.

Incorrect Answers

B:

A child output can be marked sensitive, but its underlying value may still reside in state unless it uses permitted ephemeral handling; this mechanism is useful when the job is to limit ordinary display of a sensitive result exported from a reusable module, whereas the current scenario requires the engineer to instantiate the same module with distinct environment inputs. These operations have different effects in the stated Terraform workflow.

C:

Variables declared by a child module belong to that module and receive values via the caller's module block; this mechanism is useful when the job is to make a setting available inside a called module without creating a global variable, whereas the current scenario requires the engineer to instantiate the same module with distinct environment inputs. 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 instantiate the same module with distinct environment inputs. These operations have different effects in the stated Terraform workflow.

Question 795

An engineer intends to prevent unauthorized operators from reading sensitive resource attributes and is reviewing “Remote state access controls”. What consequence follows from using it as intended?

  1. Vault can centralize secret lifecycle, policies and auditability, but provider and state-handling choices still determine whether a retrieved value is persisted.
  2. Protecting state requires backend encryption, identity-based authorization and controlled access because state can store raw secret values.
  3. Providers can often authenticate through environment variables or identity integrations so credentials are absent from checked-in HCL.
  4. Terraform 1.10+ ephemeral variables can flow only into allowed ephemeral contexts and are omitted from persisted artifacts.

Explanation

Correct Answer

B:

The named mechanism is used when the objective is to prevent unauthorized operators from reading sensitive resource attributes, so it produces the behavior described. In contrast, ephemeral = true on a variable serves a different goal: use a short-lived runtime secret without saving its value in plan or state, not prevent unauthorized operators from reading sensitive resource attributes.

Incorrect Answers

A:

The description applies to vault-backed secret retrieval when an engineer needs to retrieve an operational credential from a dedicated secret manager rather than committing it; the named remote state access controls instead handles the requirement to prevent unauthorized operators from reading sensitive resource attributes, so this behavior does not describe Remote state access controls in the situation named.

C:

The description applies to environment-based provider credentials when an engineer needs to avoid putting provider access tokens directly in configuration source; the named remote state access controls instead handles the requirement to prevent unauthorized operators from reading sensitive resource attributes, so this behavior does not describe Remote state access controls in the situation named.

D:

The description applies to ephemeral = true on a variable when an engineer needs to use a short-lived runtime secret without saving its value in plan or state; the named remote state access controls instead handles the requirement to prevent unauthorized operators from reading sensitive resource attributes, so this behavior does not describe Remote state access controls in the situation named.

Question 796

A Terraform change proposal names “A nullable variable setting” to control whether a caller can intentionally pass null to an input variable. Which outcome can reviewers attribute to that particular mechanism?

  1. An output block exposes an expression value to CLI users and supported automation or cross-configuration consumers.
  2. The nullable argument on a variable declaration determines whether null is a valid override of its normal value.
  3. Marking an output sensitive redacts ordinary CLI presentation, but does not by itself prevent storage in state.
  4. The JSON output mode serializes output values and metadata for automation; it can expose sensitive values and must be protected.

Explanation

Correct Answer

B:

The named mechanism is used when the objective is to control whether a caller can intentionally pass null to an input variable, so it produces the behavior described. In contrast, terraform output -json serves a different goal: retrieve root outputs for integration with another program, not control whether a caller can intentionally pass null to an input variable.

Incorrect Answers

A:

The description applies to a root output block when an engineer needs to publish a computed result after applying a root module; the named a nullable variable setting instead handles the requirement to control whether a caller can intentionally pass null to an input variable, so this behavior does not describe A nullable variable setting in the situation named.

C:

The description applies to a sensitive output when an engineer needs to hide a secret-like output from Terraform's usual human-readable display; the named a nullable variable setting instead handles the requirement to control whether a caller can intentionally pass null to an input variable, so this behavior does not describe A nullable variable setting in the situation named.

D:

The description applies to terraform output -json when an engineer needs to retrieve root outputs for integration with another program; the named a nullable variable setting instead handles the requirement to control whether a caller can intentionally pass null to an input variable, so this behavior does not describe A nullable variable setting in the situation named.

Question 797

A configuration review for an application stack needs to test whether evaluating an expression would cause a dynamic error. Which feature or operation is the most direct match?

  1. The base64encode function
  2. The can function
  3. The sha256 function
  4. The merge function

Explanation

Correct Answer

B:

can(expression) returns false when evaluation raises an error, which is useful in validation but not for general error swallowing; this directly meets the requirement to test whether evaluating an expression would cause a dynamic error. By comparison, the sha256 function is intended to create a deterministic SHA-256 digest for content comparison, which is a different task from test whether evaluating an expression would cause a dynamic error.

Incorrect Answers

A:

base64encode applies a reversible encoding and should not be mistaken for encryption of secrets; this mechanism is useful when the job is to turn ordinary string content into Base64 text, whereas the current scenario requires the engineer to test whether evaluating an expression would cause a dynamic error. These operations have different effects in the stated Terraform workflow.

C:

sha256 computes a one-way hash of a string, not an encrypted recoverable secret or random credential; this mechanism is useful when the job is to create a deterministic SHA-256 digest for content comparison, whereas the current scenario requires the engineer to test whether evaluating an expression would cause a dynamic error. These operations have different effects in the stated Terraform workflow.

D:

merge overlays object or map arguments and chooses the value from the last argument containing a duplicate key; this mechanism is useful when the job is to combine maps with later values overriding earlier keys, whereas the current scenario requires the engineer to test whether evaluating an expression would cause a dynamic error. These operations have different effects in the stated Terraform workflow.

Question 798

A release pipeline preparing provider access has a concrete implementation goal: reuse a provider whose source address differs from its short local identifier. What is the most appropriate Terraform mechanism?

  1. Explicit provider selection on data blocks
  2. Provider-local name mapping
  3. Separate required provider names
  4. Provider configuration at the root

Explanation

Correct Answer

B:

The required_providers entry maps the chosen local name to a specific fully qualified provider source address; this directly meets the requirement to reuse a provider whose source address differs from its short local identifier. By comparison, provider configuration at the root is intended to supply provider configurations from the root module to reusable child modules, which is a different task from reuse a provider whose source address differs from its short local identifier.

Incorrect Answers

A:

A data block can set provider = aws.secondary to query through an alternate provider configuration; this mechanism is useful when the job is to read an object from a secondary account rather than the default account, whereas the current scenario requires the engineer to reuse a provider whose source address differs from its short local identifier. These operations have different effects in the stated Terraform workflow.

C:

List both plugins under required_providers and configure each service's provider independently as needed; this mechanism is useful when the job is to use two unrelated service APIs in one root configuration, whereas the current scenario requires the engineer to reuse a provider whose source address differs from its short local identifier. These operations have different effects in the stated Terraform workflow.

D:

Reusable child modules should primarily declare provider requirements and receive configurations from callers rather than embedding fixed credentials; this mechanism is useful when the job is to supply provider configurations from the root module to reusable child modules, whereas the current scenario requires the engineer to reuse a provider whose source address differs from its short local identifier. These operations have different effects in the stated Terraform workflow.

Question 799

A reusable infrastructure definition requires a way to load a conventional set of root-module variable assignments automatically. Which Terraform approach most directly fulfills that request?

  1. A variable default value
  2. A root output block
  3. A locals block
  4. A terraform.tfvars file

Explanation

Correct Answer

D:

Terraform automatically discovers terraform.tfvars and terraform.tfvars.json in the working directory; this directly meets the requirement to load a conventional set of root-module variable assignments automatically. By comparison, a root output block is intended to publish a computed result after applying a root module, which is a different task from load a conventional set of root-module variable assignments automatically.

Incorrect Answers

A:

The default argument supplies a value when the caller provides no other assignment for that variable; this mechanism is useful when the job is to make a module input optional for callers using a common baseline, whereas the current scenario requires the engineer to load a conventional set of root-module variable assignments automatically. These operations have different effects in the stated Terraform workflow.

B:

An output block exposes an expression value to CLI users and supported automation or cross-configuration consumers; this mechanism is useful when the job is to publish a computed result after applying a root module, whereas the current scenario requires the engineer to load a conventional set of root-module variable assignments automatically. These operations have different effects in the stated Terraform workflow.

C:

Local values are internal named expressions accessed using local.NAME; they are not module input parameters; this mechanism is useful when the job is to compute and reuse a derived expression without asking callers to supply it, whereas the current scenario requires the engineer to load a conventional set of root-module variable assignments automatically. These operations have different effects in the stated Terraform workflow.

Question 800

An infrastructure architecture discussion has a concrete implementation goal: deploy similarly structured stacks with environment-specific settings. What is the most appropriate Terraform mechanism?

  1. Collaboration through remote state
  2. Plan-before-apply reviews
  3. Idempotent convergence
  4. Environment parametrization

Explanation

Correct Answer

D:

Terraform input variables permit different values for capacity, names and endpoints without copying the entire resource definition; this directly meets the requirement to deploy similarly structured stacks with environment-specific settings. By comparison, idempotent convergence is intended to run unchanged configuration repeatedly without inventing new infrastructure updates, which is a different task from deploy similarly structured stacks with environment-specific settings.

Incorrect Answers

A:

A backend supporting remote storage and locking can centralize state and prevent conflicting concurrent changes; this mechanism is useful when the job is to allow authorized operators to use one shared source of Terraform state, whereas the current scenario requires the engineer to deploy similarly structured stacks with environment-specific settings. These operations have different effects in the stated Terraform workflow.

B:

A Terraform plan is a reviewable proposed set of actions; execution occurs only when an apply runs against the chosen plan; this mechanism is useful when the job is to see intended infrastructure changes without immediately creating them, whereas the current scenario requires the engineer to deploy similarly structured stacks with environment-specific settings. These operations have different effects in the stated Terraform workflow.

C:

With no configuration or remote drift requiring action, a new plan normally proposes no infrastructure changes; this mechanism is useful when the job is to run unchanged configuration repeatedly without inventing new infrastructure updates, whereas the current scenario requires the engineer to deploy similarly structured stacks with environment-specific settings. These operations have different effects in the stated Terraform workflow.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests