HashiCorp Terraform Associate 004 (HashiCorp Certified: Terraform Associate (004)) Practice Test 14

Question 130

A Terraform runbook describes the mechanism "Pinned Git module ref". Which responsibility should a reviewer associate with it?

  1. choose an explicit compatible release of a registry module
  2. select a Terraform module within a larger repository
  3. load a reusable module from a directory in the same repository
  4. use a chosen module branch, tag, or commit from a Git source
  5. find documented reusable modules rather than copying configurations manually

Explanation

Correct Answer

D:

The practical result of Pinned Git module ref, used to use a chosen module branch, tag, or commit from a Git source, is: A Git module source can use ?ref=... to select the intended revision. A qualification for this effect is: A floating branch can change over time and weaken reproducibility.

Incorrect Answers

A:

That outcome applies to Registry module version selection, intended to choose an explicit compatible release of a registry module, rather than the question's feature Pinned Git module ref: The version argument on a registry module call constrains which published module release is installed. Unlike Registry module version selection, Pinned Git module ref is intended to use a chosen module branch, tag, or commit from a Git source, not to choose an explicit compatible release of a registry module.

B:

That outcome applies to Module source subdirectory, intended to select a Terraform module within a larger repository, rather than the question's feature Pinned Git module ref: The double-slash syntax in supported remote sources identifies a module subdirectory within the downloaded package. Unlike Module source subdirectory, Pinned Git module ref is intended to use a chosen module branch, tag, or commit from a Git source, not to select a Terraform module within a larger repository.

C:

That outcome applies to Local child module source, intended to load a reusable module from a directory in the same repository, rather than the question's feature Pinned Git module ref: A source like ./modules/network points a module call at a local filesystem path. Unlike Local child module source, Pinned Git module ref is intended to use a chosen module branch, tag, or commit from a Git source, not to load a reusable module from a directory in the same repository.

E:

That outcome applies to Module discovery in registry, intended to find documented reusable modules rather than copying configurations manually, rather than the question's feature Pinned Git module ref: The Terraform Registry and private module registries can publish modules with inputs and outputs. Unlike Module discovery in registry, Pinned Git module ref is intended to use a chosen module branch, tag, or commit from a Git source, not to find documented reusable modules rather than copying configurations manually.

Question 131

A configuration walkthrough identifies "Remote run approval". Which task is it principally intended to support?

  1. store workspace state centrally rather than on a personal machine
  2. review a planned change in the HCP Terraform run interface before apply
  3. start remote plans from connected version-control updates
  4. isolate the state, variables, and run history for one managed infrastructure unit
  5. execute Terraform operations in a managed remote runtime

Explanation

Correct Answer

B:

The practical result of Remote run approval, used to review a planned change in the HCP Terraform run interface before apply, is: An HCP workspace can separate planning and apply confirmation for controlled changes. A qualification for this effect is: A speculative plan from a pull request is not the same as an authorized apply run.

Incorrect Answers

A:

That outcome applies to HCP Terraform state storage, intended to store workspace state centrally rather than on a personal machine, rather than the question's feature Remote run approval: HCP Terraform manages workspace state snapshots with controlled access and history. Unlike HCP Terraform state storage, Remote run approval is intended to review a planned change in the HCP Terraform run interface before apply, not to store workspace state centrally rather than on a personal machine.

C:

That outcome applies to VCS-driven HCP Terraform workflow, intended to start remote plans from connected version-control updates, rather than the question's feature Remote run approval: A VCS-connected workspace can queue runs when matching configuration changes are committed. Unlike VCS-driven HCP Terraform workflow, Remote run approval is intended to review a planned change in the HCP Terraform run interface before apply, not to start remote plans from connected version-control updates.

D:

That outcome applies to HCP Terraform workspace, intended to isolate the state, variables, and run history for one managed infrastructure unit, rather than the question's feature Remote run approval: An HCP Terraform workspace organizes a Terraform run context with its own state and configuration connection. Unlike HCP Terraform workspace, Remote run approval is intended to review a planned change in the HCP Terraform run interface before apply, not to isolate the state, variables, and run history for one managed infrastructure unit.

E:

That outcome applies to HCP Terraform remote execution, intended to execute Terraform operations in a managed remote runtime, rather than the question's feature Remote run approval: HCP Terraform can run plans and applies outside a developer's workstation under workspace controls. Unlike HCP Terraform remote execution, Remote run approval is intended to review a planned change in the HCP Terraform run interface before apply, not to execute Terraform operations in a managed remote runtime.

Question 132

A Terraform rollout has two separate requirements: first, map a discovered object to the intended Terraform resource instance address; second, adopt a remote object from the correct account or region. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Generate import configuration where supported; then use Import validation follow-up.
  2. First use Import under aliased provider; then use Import resource address matching.
  3. First use Import resource address matching; then use Generate import configuration where supported.
  4. First use Import resource address matching; then use Import under aliased provider.
  5. First use Import validation follow-up; then use Import under aliased provider.

Explanation

Correct Answer

D:

The first requirement, to map a discovered object to the intended Terraform resource instance address, is handled by Import resource address matching: Import uses a Terraform resource address that corresponds to the configuration intended to manage the object. The second requirement, to adopt a remote object from the correct account or region, is handled by Import under aliased provider: The target resource's selected provider configuration determines how Terraform locates and reads the imported object. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to map a discovered object to the intended Terraform resource instance address and adopt a remote object from the correct account or region, the first candidate Generate import configuration where supported addresses use import planning support to help write resource HCL for an existing object; the second candidate Import validation follow-up addresses run a plan after importing an object to check unexpected updates. This mapping fails because the first mechanism primarily supports the task to use import planning support to help write resource HCL for an existing object and the second mechanism primarily supports the task to run a plan after importing an object to check unexpected updates; the actual requirements are map a discovered object to the intended Terraform resource instance address first and adopt a remote object from the correct account or region second.

B:

For the requested tasks to map a discovered object to the intended Terraform resource instance address and adopt a remote object from the correct account or region, the first candidate Import under aliased provider addresses adopt a remote object from the correct account or region; the second candidate Import resource address matching addresses map a discovered object to the intended Terraform resource instance address. This mapping fails because the first mechanism primarily supports the task to adopt a remote object from the correct account or region and the second mechanism primarily supports the task to map a discovered object to the intended Terraform resource instance address; the actual requirements are map a discovered object to the intended Terraform resource instance address first and adopt a remote object from the correct account or region second.

C:

For the requested tasks to map a discovered object to the intended Terraform resource instance address and adopt a remote object from the correct account or region, the first candidate Import resource address matching addresses map a discovered object to the intended Terraform resource instance address; the second candidate Generate import configuration where supported addresses use import planning support to help write resource HCL for an existing object. This mapping fails because the second mechanism primarily supports the task to use import planning support to help write resource HCL for an existing object; the actual requirements are map a discovered object to the intended Terraform resource instance address first and adopt a remote object from the correct account or region second.

E:

For the requested tasks to map a discovered object to the intended Terraform resource instance address and adopt a remote object from the correct account or region, the first candidate Import validation follow-up addresses run a plan after importing an object to check unexpected updates; the second candidate Import under aliased provider addresses adopt a remote object from the correct account or region. This mapping fails because the first mechanism primarily supports the task to run a plan after importing an object to check unexpected updates; the actual requirements are map a discovered object to the intended Terraform resource instance address first and adopt a remote object from the correct account or region second.

Question 133

In a reusable deployment, the primary objective is to defer a read when its arguments depend on a resource still being created. Which mechanism most directly meets this particular need?

  1. Read-only cross-account lookup
  2. Data source dependency scheduling
  3. Resource type and local name
  4. Managed resource block

Explanation

Correct Answer

B:

The task is to defer a read when its arguments depend on a resource still being created; Data source dependency scheduling directly supports that requirement: Terraform tracks references to determine whether a data-source read can run during planning or must wait. Its relevant boundary is: A data source does not automatically establish ownership over the queried object.

Incorrect Answers

A:

Read-only cross-account lookup is designed to obtain a shared network identifier owned by a different deployment team, whereas this task is to defer a read when its arguments depend on a resource still being created: A data source reads a shared object if the provider configuration has permission to access it. Against Data source dependency scheduling, its limitation is: Reading does not transfer ownership to the consuming root module.

C:

Resource type and local name is designed to distinguish a provider-defined resource kind from its Terraform address label, whereas this task is to defer a read when its arguments depend on a resource still being created: A resource block has both a resource type and local name, forming references like aws_vpc.main. Against Data source dependency scheduling, its limitation is: Changing the local name can change the state address unless migrated.

D:

Managed resource block addresses the different requirement to ask Terraform to create and maintain an infrastructure object: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider; this does not by itself satisfy the requested task to defer a read when its arguments depend on a resource still being created. For the stated need, Data source dependency scheduling is the more direct mechanism.

Question 134

The rollout owner asks whether Configuration change cycle is sufficient to modify desired resource arguments then inspect the resulting plan. Which limitation specifically concerns that mechanism?

  1. Destroy and import are maintenance actions rather than steps in every routine run.
  2. The graph is not simply a sequential list ordered by file line number.
  3. Version control approval alone does not guarantee the exact reviewed plan is used.
  4. Editing a file does not update the cloud before apply.

Explanation

Correct Answer

D:

For Configuration change cycle in the task to modify desired resource arguments then inspect the resulting plan, the important caution is: Editing a file does not update the cloud before apply. The reason this matters is its actual behavior: Editing HCL changes intended infrastructure and a new plan reveals proposed differences.

Incorrect Answers

A:

The proposed warning belongs to Write-plan-apply lifecycle, which serves the different goal to follow the core workflow from configuration to deliberate execution, rather than to Configuration change cycle: The core workflow involves writing configuration, initializing, planning, then applying intended changes. The question concerns Configuration change cycle acting to modify desired resource arguments then inspect the resulting plan, not a limit of Write-plan-apply lifecycle.

B:

The proposed warning belongs to Plan refresh and graph evaluation, which serves the different goal to reason about dependencies before Terraform proposes remote operations, rather than to Configuration change cycle: Terraform evaluates configuration, state, and provider information to construct an action graph. The question concerns Configuration change cycle acting to modify desired resource arguments then inspect the resulting plan, not a limit of Plan refresh and graph evaluation.

C:

The proposed warning belongs to Collaborative review before apply, which serves the different goal to separate proposing infrastructure changes from authorizing them, rather than to Configuration change cycle: Teams can share configuration and review a Terraform plan before a privileged apply runs. The question concerns Configuration change cycle acting to modify desired resource arguments then inspect the resulting plan, not a limit of Collaborative review before apply.

Question 135

During a Terraform 1.12 implementation, the immediate requirement is to ask initialization to reconsider allowed provider selections. Which mechanism most directly meets this particular need?

  1. terraform init -upgrade
  2. terraform providers lock
  3. Provider version compatibility operator
  4. Provider installation during init

Explanation

Correct Answer

A:

The task is to ask initialization to reconsider allowed provider selections; terraform init -upgrade directly supports that requirement: Using -upgrade during init allows newer versions satisfying the configured provider constraints to be selected. Its relevant boundary is: It cannot override a required_providers constraint that excludes a release.

Incorrect Answers

B:

terraform providers lock is designed to populate or update provider checksum selections in the lock file, whereas this task is to ask initialization to reconsider allowed provider selections: The providers lock command can record provider package checksums for selected target platforms. Against terraform init -upgrade, its limitation is: It is not the command that downloads and configures all root-module infrastructure.

C:

Provider version compatibility operator is designed to allow only nonbreaking versions in a specified range, whereas this task is to ask initialization to reconsider allowed provider selections: A constraint like ~> 5.2 permits compatible versions within that bound while excluding the next incompatible major range. Against terraform init -upgrade, its limitation is: It is a permitted range, not proof of the installed provider's actual version.

D:

Provider installation during init is designed to download required plugins into the initialized working environment, whereas this task is to ask initialization to reconsider allowed provider selections: terraform init resolves provider dependencies and installs or reuses selected plugin packages. Against terraform init -upgrade, its limitation is: It does not apply infrastructure changes during initialization.

Question 136

The team is documenting risks of Local state access controls while planning to prevent unauthorized reading of saved infrastructure metadata. Which caveat specifically applies to that mechanism?

  1. Copying a state file between computers is error-prone and can leak secrets.
  2. A local backend cannot by itself provide shared policy controls or central audit.
  3. A backup does not make concurrent state modifications safe.
  4. State location alone does not separate permissions for remote provider resources.

Explanation

Correct Answer

B:

For Local state access controls in the task to prevent unauthorized reading of saved infrastructure metadata, the important caution is: A local backend cannot by itself provide shared policy controls or central audit. The reason this matters is its actual behavior: Filesystem permissions and secure workstation handling matter when state stays local.

Incorrect Answers

A:

The proposed warning belongs to Local backend and shared CI, which serves the different goal to avoid using workstation files as the source of truth for team deployments, rather than to Local state access controls: Local state is best suited to isolated or experimental work rather than competing team runners. The question concerns Local state access controls acting to prevent unauthorized reading of saved infrastructure metadata, not a limit of Local backend and shared CI.

C:

The proposed warning belongs to Local state backup, which serves the different goal to retain a prior state snapshot while modifying local state, rather than to Local state access controls: Local state operations commonly create backup snapshots to aid recovery from mistakes. The question concerns Local state access controls acting to prevent unauthorized reading of saved infrastructure metadata, not a limit of Local state backup.

D:

The proposed warning belongs to Custom local state path, which serves the different goal to place an isolated sandbox state file away from another lab's state, rather than to Local state access controls: A local backend path can separate state storage from another configuration's snapshot. The question concerns Local state access controls acting to prevent unauthorized reading of saved infrastructure metadata, not a limit of Custom local state path.

Question 137

The rollout owner asks whether Pinned Git module ref is sufficient to use a chosen module branch, tag, or commit from a Git source. Which limitation specifically concerns that mechanism?

  1. The path suffix does not change provider plugin version selection.
  2. The version argument is not supported for arbitrary local path modules.
  3. A published module can still depend on provider permissions and external objects.
  4. A floating branch can change over time and weaken reproducibility.

Explanation

Correct Answer

D:

For Pinned Git module ref in the task to use a chosen module branch, tag, or commit from a Git source, the important caution is: A floating branch can change over time and weaken reproducibility. The reason this matters is its actual behavior: A Git module source can use ?ref=... to select the intended revision.

Incorrect Answers

A:

The proposed warning belongs to Module source subdirectory, which serves the different goal to select a Terraform module within a larger repository, rather than to Pinned Git module ref: The double-slash syntax in supported remote sources identifies a module subdirectory within the downloaded package. The question concerns Pinned Git module ref acting to use a chosen module branch, tag, or commit from a Git source, not a limit of Module source subdirectory.

B:

The proposed warning belongs to Registry module version selection, which serves the different goal to choose an explicit compatible release of a registry module, rather than to Pinned Git module ref: The version argument on a registry module call constrains which published module release is installed. The question concerns Pinned Git module ref acting to use a chosen module branch, tag, or commit from a Git source, not a limit of Registry module version selection.

C:

The proposed warning belongs to Module discovery in registry, which serves the different goal to find documented reusable modules rather than copying configurations manually, rather than to Pinned Git module ref: The Terraform Registry and private module registries can publish modules with inputs and outputs. The question concerns Pinned Git module ref acting to use a chosen module branch, tag, or commit from a Git source, not a limit of Module discovery in registry.

Question 138

A change proposal relies on Remote run approval for the task to review a planned change in the HCP Terraform run interface before apply. Which limitation specifically applies to it?

  1. Remote execution still needs provider credentials and connectivity.
  2. A speculative plan from a pull request is not the same as an authorized apply run.
  3. It is not identical to a local CLI workspace's implementation.
  4. Its workspace settings determine whether runs need approval or are automatically applied.

Explanation

Correct Answer

B:

For Remote run approval in the task to review a planned change in the HCP Terraform run interface before apply, the important caution is: A speculative plan from a pull request is not the same as an authorized apply run. The reason this matters is its actual behavior: An HCP workspace can separate planning and apply confirmation for controlled changes.

Incorrect Answers

A:

The proposed warning belongs to HCP Terraform remote execution, which serves the different goal to execute Terraform operations in a managed remote runtime, rather than to Remote run approval: HCP Terraform can run plans and applies outside a developer's workstation under workspace controls. The question concerns Remote run approval acting to review a planned change in the HCP Terraform run interface before apply, not a limit of HCP Terraform remote execution.

C:

The proposed warning belongs to HCP Terraform workspace, which serves the different goal to isolate the state, variables, and run history for one managed infrastructure unit, rather than to Remote run approval: An HCP Terraform workspace organizes a Terraform run context with its own state and configuration connection. The question concerns Remote run approval acting to review a planned change in the HCP Terraform run interface before apply, not a limit of HCP Terraform workspace.

D:

The proposed warning belongs to VCS-driven HCP Terraform workflow, which serves the different goal to start remote plans from connected version-control updates, rather than to Remote run approval: A VCS-connected workspace can queue runs when matching configuration changes are committed. The question concerns Remote run approval acting to review a planned change in the HCP Terraform run interface before apply, not a limit of VCS-driven HCP Terraform workflow.

Question 139

A Terraform runbook describes the mechanism "Data source dependency scheduling". Which responsibility should a reviewer associate with it?

  1. obtain a shared network identifier owned by a different deployment team
  2. consume an assigned ID only after the provider supplies it
  3. distinguish a provider-defined resource kind from its Terraform address label
  4. defer a read when its arguments depend on a resource still being created

Explanation

Correct Answer

D:

The practical result of Data source dependency scheduling, used to defer a read when its arguments depend on a resource still being created, is: Terraform tracks references to determine whether a data-source read can run during planning or must wait. A qualification for this effect is: A data source does not automatically establish ownership over the queried object.

Incorrect Answers

A:

That outcome applies to Read-only cross-account lookup, intended to obtain a shared network identifier owned by a different deployment team, rather than the question's feature Data source dependency scheduling: A data source reads a shared object if the provider configuration has permission to access it. Unlike Read-only cross-account lookup, Data source dependency scheduling is intended to defer a read when its arguments depend on a resource still being created, not to obtain a shared network identifier owned by a different deployment team.

B:

That outcome applies to Resource attributes computed by provider, intended to consume an assigned ID only after the provider supplies it, rather than the question's feature Data source dependency scheduling: Computed attributes are often unknown during planning and become available after the provider creates or reads an object. Unlike Resource attributes computed by provider, Data source dependency scheduling is intended to defer a read when its arguments depend on a resource still being created, not to consume an assigned ID only after the provider supplies it.

C:

That outcome applies to Resource type and local name, intended to distinguish a provider-defined resource kind from its Terraform address label, rather than the question's feature Data source dependency scheduling: A resource block has both a resource type and local name, forming references like aws_vpc.main. Unlike Resource type and local name, Data source dependency scheduling is intended to defer a read when its arguments depend on a resource still being created, not to distinguish a provider-defined resource kind from its Terraform address label.

Question 140

A deployment design calls for a supported way to repeat an apply without recreating already matching resources. Which mechanism most directly meets this particular need?

  1. Infrastructure as code definition
  2. Terraform resource declaration
  3. Idempotent reconciliation
  4. Desired configuration

Explanation

Correct Answer

C:

The task is to repeat an apply without recreating already matching resources; Idempotent reconciliation directly supports that requirement: Terraform compares desired configuration with prior state and refreshed remote information and normally plans no change when they agree. Its relevant boundary is: An external drift or changed input can still cause a nonempty plan.

Incorrect Answers

A:

Infrastructure as code definition is designed to represent desired infrastructure in reviewable configuration files, whereas this task is to repeat an apply without recreating already matching resources: Infrastructure as code describes infrastructure through machine-readable files instead of relying only on manual console operations. Against Idempotent reconciliation, its limitation is: The configuration still needs a tool and credentials to change actual systems.

B:

Terraform resource declaration is designed to describe one managed infrastructure object in a configuration, whereas this task is to repeat an apply without recreating already matching resources: A resource block represents an object that Terraform will create, update, or destroy through a provider. Against Idempotent reconciliation, its limitation is: A resource declaration is not the same as a read-only data lookup.

D:

Desired configuration addresses the different requirement to record intended infrastructure settings under version control: Configuration expresses the operator's intended infrastructure and is the starting point for planning; this does not by itself satisfy the requested task to repeat an apply without recreating already matching resources. For the stated need, Idempotent reconciliation is the more direct mechanism.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests