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

Question 530

A platform team separating infrastructure deployments requires a way to evaluate organizational infrastructure rules during HCP Terraform runs. Which Terraform approach most directly fulfills that request?

  1. Workspace access separation
  2. HCP continuous validation
  3. Sentinel policy enforcement
  4. Organization variable sets

Explanation

Correct Answer

C:

Sentinel policies can assess planned infrastructure and produce policy check outcomes before a run can apply when enforcement requires it; this directly meets the requirement to evaluate organizational infrastructure rules during HCP Terraform runs. By comparison, workspace access separation is intended to prevent a developer with read access from automatically applying production changes, which is a different task from evaluate organizational infrastructure rules during HCP Terraform runs.

Incorrect Answers

A:

HCP Terraform permissions differentiate viewing configuration and runs from authorized apply or administration operations; this mechanism is useful when the job is to prevent a developer with read access from automatically applying production changes, whereas the current scenario requires the engineer to evaluate organizational infrastructure rules during HCP Terraform runs. These operations have different effects in the stated Terraform workflow.

B:

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 evaluate organizational infrastructure rules during HCP Terraform runs. These operations have different effects in the stated Terraform workflow.

D:

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 evaluate organizational infrastructure rules during HCP Terraform runs. These operations have different effects in the stated Terraform workflow.

Question 531

An HCP Terraform workspace design needs to delegate administration of one team's project without granting universal organization access. Which feature or operation is the most direct match?

  1. Workspace tags
  2. Workspace-specific variables
  3. Project-scoped team access
  4. Environment promotion via workspaces

Explanation

Correct Answer

C:

Project-level access scopes workspace capabilities for teams based on organizational boundaries; this directly meets the requirement to delegate administration of one team's project without granting universal organization access. By comparison, workspace tags is intended to categorize HCP Terraform workspaces for filtering or configuration selection, which is a different task from delegate administration of one team's project without granting universal organization access.

Incorrect Answers

A:

Workspace tags help group and select workspaces, including when a CLI cloud block targets tagged workspace sets; this mechanism is useful when the job is to categorize HCP Terraform workspaces for filtering or configuration selection, whereas the current scenario requires the engineer to delegate administration of one team's project without granting universal organization access. These operations have different effects in the stated Terraform workflow.

B:

Workspace settings store variables for that workspace's execution; global sets should not replace environment-specific data blindly; this mechanism is useful when the job is to override or tailor values used by one particular stack, whereas the current scenario requires the engineer to delegate administration of one team's project without granting universal organization access. These operations have different effects in the stated Terraform workflow.

D:

Workspaces can reference separate branches or release controls while retaining isolated state for each environment; this mechanism is useful when the job is to use a reviewed configuration revision across separate testing and production states, whereas the current scenario requires the engineer to delegate administration of one team's project without granting universal organization access. These operations have different effects in the stated Terraform workflow.

Question 532

An engineer intends to allow independent resources to be applied concurrently and is reviewing “Parallel graph execution”. What consequence follows from using it as intended?

  1. Terraform executes actions in graph order and can operate on independent nodes in parallel subject to provider and CLI limits.
  2. A partial apply may have changed some resources, so Terraform should refresh and build a new plan rather than blindly assuming a full rollback.
  3. The -var-file option loads values from an input variables file, enabling separate environment assignments.
  4. The -var option supplies a named input for the execution; it does not edit the variable declaration in code.

Explanation

Correct Answer

A:

The named mechanism is used when the objective is to allow independent resources to be applied concurrently, so it produces the behavior described. In contrast, apply with -var serves a different goal: override a declared root-module input value for a particular run, not allow independent resources to be applied concurrently.

Incorrect Answers

B:

The description applies to apply failure recovery when an engineer needs to inspect state and re-plan when a provider operation fails partway through; the named parallel graph execution instead handles the requirement to allow independent resources to be applied concurrently, so this behavior does not describe Parallel graph execution in the situation named.

C:

The description applies to apply with a .tfvars file when an engineer needs to supply a named collection of input assignments to Terraform; the named parallel graph execution instead handles the requirement to allow independent resources to be applied concurrently, so this behavior does not describe Parallel graph execution in the situation named.

D:

The description applies to apply with -var when an engineer needs to override a declared root-module input value for a particular run; the named parallel graph execution instead handles the requirement to allow independent resources to be applied concurrently, so this behavior does not describe Parallel graph execution in the situation named.

Question 533

A multi-provider deployment design needs to create resources in a second region using the same provider type. Which feature or operation is the most direct match?

  1. No implicit child-module alias inheritance
  2. The providers map on a module call
  3. A default provider configuration
  4. configuration_aliases in required_providers
  5. An aliased provider instance

Explanation

Correct Answer

E:

Declare an aliased provider configuration and assign provider = provider_name.alias on resources that need the alternate region; this directly meets the requirement to create resources in a second region using the same provider type. By comparison, configuration_aliases in required_providers is intended to declare which alternate provider configurations a child module is allowed to receive, which is a different task from create resources in a second region using the same provider type.

Incorrect Answers

A:

Non-default provider configurations must be passed explicitly to a child module instead of assuming aliases will propagate; this mechanism is useful when the job is to prevent a child module from silently using an unpassed alternate provider configuration, whereas the current scenario requires the engineer to create resources in a second region using the same provider type. These operations have different effects in the stated Terraform workflow.

B:

The module call's providers argument maps the child's expected provider configuration name to a provider configuration available in the parent; this mechanism is useful when the job is to pass an aliased provider configuration into a child module, whereas the current scenario requires the engineer to create resources in a second region using the same provider type. These operations have different effects in the stated Terraform workflow.

C:

An unaliased provider block configures the default instance used by matching resources that do not override provider selection; this mechanism is useful when the job is to make resources use a common account without an explicit provider argument, whereas the current scenario requires the engineer to create resources in a second region using the same provider type. These operations have different effects in the stated Terraform workflow.

D:

A child module's required_providers entry uses configuration_aliases to advertise provider aliases referenced inside the module; this mechanism is useful when the job is to declare which alternate provider configurations a child module is allowed to receive, whereas the current scenario requires the engineer to create resources in a second region using the same provider type. These operations have different effects in the stated Terraform workflow.

Question 534

During a design review, the requirement is to audit the results of infrastructure changes across a team. Which option should the engineer select?

  1. Reusable execution records
  2. Collaboration through remote state
  3. Reusing modules
  4. Code review of infrastructure

Explanation

Correct Answer

A:

Version control and run history provide traceable context for what configuration changed and what Terraform planned or applied; this directly meets the requirement to audit the results of infrastructure changes across a team. By comparison, collaboration through remote state is intended to allow authorized operators to use one shared source of Terraform state, which is a different task from audit the results of infrastructure changes across a team.

Incorrect Answers

B:

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 audit the results of infrastructure changes across a team. These operations have different effects in the stated Terraform workflow.

C:

A module packages input variables, resources and outputs so callers can reuse a consistent infrastructure design; this mechanism is useful when the job is to standardize a reusable network pattern across multiple applications, whereas the current scenario requires the engineer to audit the results of infrastructure changes across a team. These operations have different effects in the stated Terraform workflow.

D:

A version-control pull request can expose infrastructure edits to peer review, policy checks and automated validation; this mechanism is useful when the job is to catch undesirable configuration changes before deployment, whereas the current scenario requires the engineer to audit the results of infrastructure changes across a team. These operations have different effects in the stated Terraform workflow.

Question 535

A Terraform change proposal names “The sha256 function” to create a deterministic SHA-256 digest for content comparison. Which outcome can reviewers attribute to that particular mechanism?

  1. dynamic constructs blocks required by resource schemas; it does not create standalone Terraform resource declarations.
  2. flatten recursively replaces nested lists with their constituent elements, while preserving ordered traversal.
  3. sha256 computes a one-way hash of a string, not an encrypted recoverable secret or random credential.
  4. distinct returns a list with duplicates removed and retains the ordering of the first occurrence of each element.
  5. cidrsubnet derives a subnet CIDR using additional prefix bits and a network number, without provisioning a network resource.

Explanation

Correct Answer

C:

The named mechanism is used when the objective is to create a deterministic SHA-256 digest for content comparison, so it produces the behavior described. In contrast, the distinct function serves a different goal: remove repeated list values while keeping each value's first occurrence, not create a deterministic SHA-256 digest for content comparison.

Incorrect Answers

A:

The description applies to the dynamic block when an engineer needs to generate repeated nested blocks from a collection; the named the sha256 function instead handles the requirement to create a deterministic SHA-256 digest for content comparison, so this behavior does not describe The sha256 function in the situation named.

B:

The description applies to the flatten function when an engineer needs to remove nested list layers to obtain a flat sequence; the named the sha256 function instead handles the requirement to create a deterministic SHA-256 digest for content comparison, so this behavior does not describe The sha256 function in the situation named.

D:

The description applies to the distinct function when an engineer needs to remove repeated list values while keeping each value's first occurrence; the named the sha256 function instead handles the requirement to create a deterministic SHA-256 digest for content comparison, so this behavior does not describe The sha256 function in the situation named.

E:

The description applies to the cidrsubnet function when an engineer needs to calculate a nested network prefix from a parent CIDR range; the named the sha256 function instead handles the requirement to create a deterministic SHA-256 digest for content comparison, so this behavior does not describe The sha256 function in the situation named.

Question 536

A platform team separating infrastructure deployments requires a way to coordinate multiple requested changes against the same workspace state. Which Terraform approach most directly fulfills that request?

  1. HCP Terraform remote state
  2. A speculative HCP plan
  3. A run plan phase
  4. Workspace outputs
  5. A workspace variable
  6. The HCP run queue

Explanation

Correct Answer

F:

Queued runs and workspace run management help serialize changes and avoid competing applies to one state; this directly meets the requirement to coordinate multiple requested changes against the same workspace state. By comparison, a run plan phase is intended to review infrastructure differences before applying a workspace change, which is a different task from coordinate multiple requested changes against the same workspace state.

Incorrect Answers

A:

HCP Terraform maintains workspace state versions and supports collaboration without exposing a machine-local canonical state file; this mechanism is useful when the job is to store Terraform state under managed service controls rather than a local file, whereas the current scenario requires the engineer to coordinate multiple requested changes against the same workspace state. These operations have different effects in the stated Terraform workflow.

B:

HCP Terraform can perform speculative plans for VCS changes to preview impact before merge or approval; this mechanism is useful when the job is to evaluate a pull request's proposed changes without immediately applying them, whereas the current scenario requires the engineer to coordinate multiple requested changes against the same workspace state. These operations have different effects in the stated Terraform workflow.

C:

HCP Terraform runs have plan stages where proposed infrastructure operations can be inspected and checked; this mechanism is useful when the job is to review infrastructure differences before applying a workspace change, whereas the current scenario requires the engineer to coordinate multiple requested changes against the same workspace state. These operations have different effects in the stated Terraform workflow.

D:

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 coordinate multiple requested changes against the same workspace state. These operations have different effects in the stated Terraform workflow.

E:

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 coordinate multiple requested changes against the same workspace state. These operations have different effects in the stated Terraform workflow.

Question 537

A runbook lists “A pessimistic module version constraint” for the task to allow compatible patch updates within a module's minor release series. Which technical effect should its description include?

  1. A module version ~> 2.1.0 permits 2.1.x releases but excludes 2.2.0 and later.
  2. The upgrade mode reselects module versions subject to constraints instead of automatically keeping the previously installed copy.
  3. The module version argument accepts version constraints for registry sources and Terraform resolves compatible published releases during init.
  4. Changing a module source or version constraint requires reinitializing to resolve the updated selection.

Explanation

Correct Answer

A:

The named mechanism is used when the objective is to allow compatible patch updates within a module's minor release series, so it produces the behavior described. In contrast, init after module version change serves a different goal: install a newly allowed child module release after editing its version requirement, not allow compatible patch updates within a module's minor release series.

Incorrect Answers

B:

The description applies to init -upgrade for registry modules when an engineer needs to consider newer published module releases already allowed by a version constraint; the named a pessimistic module version constraint instead handles the requirement to allow compatible patch updates within a module's minor release series, so this behavior does not describe A pessimistic module version constraint in the situation named.

C:

The description applies to a registry module version constraint when an engineer needs to select a supported module release range from the registry; the named a pessimistic module version constraint instead handles the requirement to allow compatible patch updates within a module's minor release series, so this behavior does not describe A pessimistic module version constraint in the situation named.

D:

The description applies to init after module version change when an engineer needs to install a newly allowed child module release after editing its version requirement; the named a pessimistic module version constraint instead handles the requirement to allow compatible patch updates within a module's minor release series, so this behavior does not describe A pessimistic module version constraint in the situation named.

Question 538

A team compares Terraform mechanisms for the goal to detect and propose correction for changes made outside Terraform. Which stated consequence belongs specifically to “A normal plan with drift”?

  1. Import commands require the provider-defined identity format, not an arbitrary local Terraform block label.
  2. Providers refresh remote resource attributes, and planning can propose updates to bring changed objects back to declared configuration.
  3. The state rm command removes the association so the remote object remains but is no longer tracked by that state.
  4. The state mv command reassigns a managed resource's address without contacting the provider to destroy the object.

Explanation

Correct Answer

B:

The named mechanism is used when the objective is to detect and propose correction for changes made outside Terraform, so it produces the behavior described. In contrast, terraform state rm serves a different goal: forget a managed object without destroying the corresponding real infrastructure, not detect and propose correction for changes made outside Terraform.

Incorrect Answers

A:

The description applies to import IDs defined by providers when an engineer needs to map an existing object's correct remote identifier to a Terraform address; the named a normal plan with drift instead handles the requirement to detect and propose correction for changes made outside Terraform, so this behavior does not describe A normal plan with drift in the situation named.

C:

The description applies to terraform state rm when an engineer needs to forget a managed object without destroying the corresponding real infrastructure; the named a normal plan with drift instead handles the requirement to detect and propose correction for changes made outside Terraform, so this behavior does not describe A normal plan with drift in the situation named.

D:

The description applies to terraform state mv when an engineer needs to change the address of a tracked object directly within state; the named a normal plan with drift instead handles the requirement to detect and propose correction for changes made outside Terraform, so this behavior does not describe A normal plan with drift in the situation named.

Question 539

A runbook lists “The check block” for the task to report a failed ongoing infrastructure assertion without ordinarily blocking the apply. Which technical effect should its description include?

  1. Check assertions evaluate health expectations and normally report warning diagnostics rather than blocking deployment on a false condition.
  2. A postcondition evaluates a condition concerning resource results and blocks downstream use when its assertion fails.
  3. A precondition can express a domain requirement such as a selected image having an expected property before using it.
  4. The validation block uses a condition and a custom error_message to enforce rules on caller-supplied values.

Explanation

Correct Answer

A:

The named mechanism is used when the objective is to report a failed ongoing infrastructure assertion without ordinarily blocking the apply, so it produces the behavior described. In contrast, input variable validation serves a different goal: reject malformed module inputs before provisioning resources, not report a failed ongoing infrastructure assertion without ordinarily blocking the apply.

Incorrect Answers

B:

The description applies to resource postcondition when an engineer needs to verify an invariant about a resource after reading or managing it; the named the check block instead handles the requirement to report a failed ongoing infrastructure assertion without ordinarily blocking the apply, so this behavior does not describe The check block in the situation named.

C:

The description applies to preconditions for external assumptions when an engineer needs to guard a resource against prerequisites outside the provider's basic schema; the named the check block instead handles the requirement to report a failed ongoing infrastructure assertion without ordinarily blocking the apply, so this behavior does not describe The check block in the situation named.

D:

The description applies to input variable validation when an engineer needs to reject malformed module inputs before provisioning resources; the named the check block instead handles the requirement to report a failed ongoing infrastructure assertion without ordinarily blocking the apply, so this behavior does not describe The check block in the situation named.

Question 540

A Terraform state maintenance procedure requires a way to release a stale lock when the original process is definitively gone. Which Terraform approach most directly fulfills that request?

  1. HCP Terraform run serialization
  2. terraform force-unlock
  3. terraform plan -lock-timeout
  4. State consistency during CI

Explanation

Correct Answer

B:

The force-unlock command removes a lock by its identifier; using it during an active operation can cause state corruption; this directly meets the requirement to release a stale lock when the original process is definitively gone. By comparison, HCP Terraform run serialization is intended to avoid multiple infrastructure applies targeting the same shared HCP workspace state, which is a different task from release a stale lock when the original process is definitively gone.

Incorrect Answers

A:

HCP Terraform coordinates workspace runs and state handling, reducing conflicts among collaborating operators; this mechanism is useful when the job is to avoid multiple infrastructure applies targeting the same shared HCP workspace state, whereas the current scenario requires the engineer to release a stale lock when the original process is definitively gone. These operations have different effects in the stated Terraform workflow.

C:

The lock-timeout option lets Terraform retry lock acquisition for a specified duration before returning an error; this mechanism is useful when the job is to wait for a temporary state lock instead of failing immediately, whereas the current scenario requires the engineer to release a stale lock when the original process is definitively gone. These operations have different effects in the stated Terraform workflow.

D:

A state backend with locking helps serialize competing changes, complemented by pipeline approval and run coordination; this mechanism is useful when the job is to keep two pipelines from changing the same infrastructure state simultaneously, whereas the current scenario requires the engineer to release a stale lock when the original process is definitively gone. These operations have different effects in the stated Terraform workflow.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests