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

Question 150

Before continuing an infrastructure rollout, the operator must avoid using workstation files as the source of truth for team deployments. Which mechanism most directly meets this particular need?

  1. Local workspace state files
  2. Local backend configuration
  3. Default local state storage
  4. Local backend and shared CI

Explanation

Correct Answer

D:

The task is to avoid using workstation files as the source of truth for team deployments; Local backend and shared CI directly supports that requirement: Local state is best suited to isolated or experimental work rather than competing team runners. Its relevant boundary is: Copying a state file between computers is error-prone and can leak secrets.

Incorrect Answers

A:

Local workspace state files is designed to distinguish state of different local Terraform workspaces, whereas this task is to avoid using workstation files as the source of truth for team deployments: Non-default local workspace state snapshots can be kept in a terraform.tfstate.d structure. Against Local backend and shared CI, its limitation is: Separate workspace state does not change the configuration code automatically.

B:

Local backend configuration is designed to choose a particular path for a locally stored Terraform state file, whereas this task is to avoid using workstation files as the source of truth for team deployments: The local backend supports a path setting to change where state is written. Against Local backend and shared CI, its limitation is: A custom local path still resides on the operator's filesystem.

C:

Default local state storage is designed to keep a standalone project's state on its local filesystem, whereas this task is to avoid using workstation files as the source of truth for team deployments: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Against Local backend and shared CI, its limitation is: A local file does not provide multi-user remote collaboration guarantees.

Question 151

During an implementation review, a Terraform team encounters "Idempotent reconciliation". Which purpose is associated with that mechanism?

  1. record intended infrastructure settings under version control
  2. specify an end state rather than every API request
  3. represent desired infrastructure in reviewable configuration files
  4. repeat an apply without recreating already matching resources
  5. describe one managed infrastructure object in a configuration

Explanation

Correct Answer

D:

The practical result of Idempotent reconciliation, used to repeat an apply without recreating already matching resources, is: Terraform compares desired configuration with prior state and refreshed remote information and normally plans no change when they agree. A qualification for this effect is: An external drift or changed input can still cause a nonempty plan.

Incorrect Answers

A:

That outcome applies to Desired configuration, intended to record intended infrastructure settings under version control, rather than the question's feature Idempotent reconciliation: Configuration expresses the operator's intended infrastructure and is the starting point for planning. Unlike Desired configuration, Idempotent reconciliation is intended to repeat an apply without recreating already matching resources, not to record intended infrastructure settings under version control.

B:

That outcome applies to Declarative infrastructure model, intended to specify an end state rather than every API request, rather than the question's feature Idempotent reconciliation: A declarative model states the desired objects and lets Terraform determine an execution path from configuration and state. Unlike Declarative infrastructure model, Idempotent reconciliation is intended to repeat an apply without recreating already matching resources, not to specify an end state rather than every API request.

C:

That outcome applies to Infrastructure as code definition, intended to represent desired infrastructure in reviewable configuration files, rather than the question's feature Idempotent reconciliation: Infrastructure as code describes infrastructure through machine-readable files instead of relying only on manual console operations. Unlike Infrastructure as code definition, Idempotent reconciliation is intended to repeat an apply without recreating already matching resources, not to represent desired infrastructure in reviewable configuration files.

E:

That outcome applies to Terraform resource declaration, intended to describe one managed infrastructure object in a configuration, rather than the question's feature Idempotent reconciliation: A resource block represents an object that Terraform will create, update, or destroy through a provider. Unlike Terraform resource declaration, Idempotent reconciliation is intended to repeat an apply without recreating already matching resources, not to describe one managed infrastructure object in a configuration.

Question 152

A deployment design calls for a supported way to choose an explicit compatible release of a registry module. Which mechanism most directly meets this particular need?

  1. Public registry module source
  2. Local child module source
  3. Registry module version selection
  4. Git-hosted module source

Explanation

Correct Answer

C:

The task is to choose an explicit compatible release of a registry module; Registry module version selection directly supports that requirement: The version argument on a registry module call constrains which published module release is installed. Its relevant boundary is: The version argument is not supported for arbitrary local path modules.

Incorrect Answers

A:

Public registry module source is designed to reuse a published module from the Terraform Registry, whereas this task is to choose an explicit compatible release of a registry module: Registry source addresses identify published module packages by namespace, name, and provider. Against Registry module version selection, its limitation is: Review source quality and pin an appropriate version instead of assuming every module is vetted.

B:

Local child module source is designed to load a reusable module from a directory in the same repository, whereas this task is to choose an explicit compatible release of a registry module: A source like ./modules/network points a module call at a local filesystem path. Against Registry module version selection, its limitation is: Local module paths do not use registry module version arguments.

D:

Git-hosted module source is designed to reference a reusable Terraform module from a VCS repository, whereas this task is to choose an explicit compatible release of a registry module: A git:: URL can fetch a module from a Git repository using supported source syntax. Against Registry module version selection, its limitation is: A Git module is not selected by the registry-only version argument.

Question 153

In a reusable deployment, the primary objective is to queue runs through an API integration instead of only direct Git events. Which mechanism most directly meets this particular need?

  1. HCP Terraform agent
  2. HCP Terraform API-driven run
  3. Remote run approval
  4. HCP Terraform workspace

Explanation

Correct Answer

B:

The task is to queue runs through an API integration instead of only direct Git events; HCP Terraform API-driven run directly supports that requirement: The HCP Terraform API can support workflows that upload configuration and trigger managed runs. Its relevant boundary is: An API workflow must still authenticate and choose the intended workspace.

Incorrect Answers

A:

HCP Terraform agent is designed to execute Terraform with network access to private environments, whereas this task is to queue runs through an API integration instead of only direct Git events: An HCP Terraform agent can run work in an operator-controlled environment and connect to private resources. Against HCP Terraform API-driven run, its limitation is: An agent requires setup and does not make inaccessible endpoints public.

C:

Remote run approval is designed to review a planned change in the HCP Terraform run interface before apply, whereas this task is to queue runs through an API integration instead of only direct Git events: An HCP workspace can separate planning and apply confirmation for controlled changes. Against HCP Terraform API-driven run, its limitation is: A speculative plan from a pull request is not the same as an authorized apply run.

D:

HCP Terraform workspace addresses the different requirement to isolate the state, variables, and run history for one managed infrastructure unit: An HCP Terraform workspace organizes a Terraform run context with its own state and configuration connection; this does not by itself satisfy the requested task to queue runs through an API integration instead of only direct Git events. For the stated need, HCP Terraform API-driven run is the more direct mechanism.

Question 154

During an implementation review, a Terraform team encounters "Import without recreation". Which purpose is associated with that mechanism?

  1. map a discovered object to the intended Terraform resource instance address
  2. declare an import target for normal planning and apply
  3. adopt a remote object from the correct account or region
  4. bring a pre-existing remote object under a resource address in Terraform state
  5. adopt an existing object rather than creating a new duplicate

Explanation

Correct Answer

E:

The practical result of Import without recreation, used to adopt an existing object rather than creating a new duplicate, is: Import connects an existing provider object to the Terraform state mapping. A qualification for this effect is: A post-import plan must still be checked for configuration differences.

Incorrect Answers

A:

That outcome applies to Import resource address matching, intended to map a discovered object to the intended Terraform resource instance address, rather than the question's feature Import without recreation: Import uses a Terraform resource address that corresponds to the configuration intended to manage the object. Unlike Import resource address matching, Import without recreation is intended to adopt an existing object rather than creating a new duplicate, not to map a discovered object to the intended Terraform resource instance address.

B:

That outcome applies to Configuration-driven import block, intended to declare an import target for normal planning and apply, rather than the question's feature Import without recreation: An import block can specify a resource address and provider-specific identity for import. Unlike Configuration-driven import block, Import without recreation is intended to adopt an existing object rather than creating a new duplicate, not to declare an import target for normal planning and apply.

C:

That outcome applies to Import under aliased provider, intended to adopt a remote object from the correct account or region, rather than the question's feature Import without recreation: The target resource's selected provider configuration determines how Terraform locates and reads the imported object. Unlike Import under aliased provider, Import without recreation is intended to adopt an existing object rather than creating a new duplicate, not to adopt a remote object from the correct account or region.

D:

That outcome applies to terraform import CLI, intended to bring a pre-existing remote object under a resource address in Terraform state, rather than the question's feature Import without recreation: terraform import ADDRESS ID binds the specified remote object to a declared resource instance. Unlike terraform import CLI, Import without recreation is intended to adopt an existing object rather than creating a new duplicate, not to bring a pre-existing remote object under a resource address in Terraform state.

Question 155

A Terraform operator is specifically tasked to pass the generated ID of one resource into a dependent resource. Which mechanism most directly meets this particular need?

  1. Direct attribute reference
  2. Resource address for count instance
  3. Module output reference
  4. Implicit resource dependency
  5. Resource address for for_each instance

Explanation

Correct Answer

A:

The task is to pass the generated ID of one resource into a dependent resource; Direct attribute reference directly supports that requirement: An expression such as aws_vpc.main.id links a consuming argument to an upstream resource attribute. Its relevant boundary is: Using a plain string ID loses that implicit graph dependency.

Incorrect Answers

B:

Resource address for count instance is designed to select the exact indexed instance from count-created resources, whereas this task is to pass the generated ID of one resource into a dependent resource: Count-created instances use numeric indices in expressions and state addresses, such as example[1]. Against Direct attribute reference, its limitation is: The index is not a stable semantic key if list ordering changes.

C:

Module output reference is designed to use a value explicitly exported by a child module, whereas this task is to pass the generated ID of one resource into a dependent resource: The parent reads a child output through module.name.output_name rather than reaching into child internals. Against Direct attribute reference, its limitation is: Unexported child resource attributes are not directly available to the caller.

D:

Implicit resource dependency is designed to ensure a dependent resource waits for a referenced upstream attribute, whereas this task is to pass the generated ID of one resource into a dependent resource: Terraform infers dependencies when expressions reference other resources. Against Direct attribute reference, its limitation is: An explicit depends_on is unnecessary for relationships already expressed through references.

E:

Resource address for for_each instance is designed to refer to an instance selected by its map or set key, whereas this task is to pass the generated ID of one resource into a dependent resource: A for_each resource uses keyed addressing such as example["prod"] and exposes a key-specific object. Against Direct attribute reference, its limitation is: A numeric count index is not interchangeable with a for_each string key.

Question 156

A team reviews the use of Dependency-aware parallelism in Terraform 1.12. Which purpose matches its actual behavior?

  1. apply the reviewed plan artifact rather than recomputing from changed inputs
  2. allow independent resources to be managed concurrently within one run
  3. follow the core workflow from configuration to deliberate execution
  4. separate proposing infrastructure changes from authorizing them
  5. modify desired resource arguments then inspect the resulting plan
  6. review planned deletion before permitting an irreversible action

Explanation

Correct Answer

B:

The practical result of Dependency-aware parallelism, used to allow independent resources to be managed concurrently within one run, is: Terraform uses its dependency graph to schedule actions that have no ordering relationship. A qualification for this effect is: Concurrency still needs backend locking when several runs target the same state.

Incorrect Answers

A:

That outcome applies to Saved plan promotion, intended to apply the reviewed plan artifact rather than recomputing from changed inputs, rather than the question's feature Dependency-aware parallelism: terraform plan -out creates a binary plan that terraform apply can execute by file name. Unlike Saved plan promotion, Dependency-aware parallelism is intended to allow independent resources to be managed concurrently within one run, not to apply the reviewed plan artifact rather than recomputing from changed inputs.

C:

That outcome applies to Write-plan-apply lifecycle, intended to follow the core workflow from configuration to deliberate execution, rather than the question's feature Dependency-aware parallelism: The core workflow involves writing configuration, initializing, planning, then applying intended changes. Unlike Write-plan-apply lifecycle, Dependency-aware parallelism is intended to allow independent resources to be managed concurrently within one run, not to follow the core workflow from configuration to deliberate execution.

D:

That outcome applies to Collaborative review before apply, intended to separate proposing infrastructure changes from authorizing them, rather than the question's feature Dependency-aware parallelism: Teams can share configuration and review a Terraform plan before a privileged apply runs. Unlike Collaborative review before apply, Dependency-aware parallelism is intended to allow independent resources to be managed concurrently within one run, not to separate proposing infrastructure changes from authorizing them.

E:

That outcome applies to Configuration change cycle, intended to modify desired resource arguments then inspect the resulting plan, rather than the question's feature Dependency-aware parallelism: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. Unlike Configuration change cycle, Dependency-aware parallelism is intended to allow independent resources to be managed concurrently within one run, not to modify desired resource arguments then inspect the resulting plan.

F:

That outcome applies to Plan inspection checkpoint, intended to review planned deletion before permitting an irreversible action, rather than the question's feature Dependency-aware parallelism: A review of change symbols and affected addresses can reveal unexpected destroy or replacement operations. Unlike Plan inspection checkpoint, Dependency-aware parallelism is intended to allow independent resources to be managed concurrently within one run, not to review planned deletion before permitting an irreversible action.

Question 157

A design uses terraform init -upgrade to ask initialization to reconsider allowed provider selections. Which qualification applies to the named mechanism?

  1. It is not the command that downloads and configures all root-module infrastructure.
  2. A provider block configures an installed provider instance rather than declaring its source.
  3. It does not apply infrastructure changes during initialization.
  4. It cannot override a required_providers constraint that excludes a release.
  5. It is a permitted range, not proof of the installed provider's actual version.

Explanation

Correct Answer

D:

For terraform init -upgrade in the task to ask initialization to reconsider allowed provider selections, the important caution is: It cannot override a required_providers constraint that excludes a release. The reason this matters is its actual behavior: Using -upgrade during init allows newer versions satisfying the configured provider constraints to be selected.

Incorrect Answers

A:

The proposed warning belongs to terraform providers lock, which serves the different goal to populate or update provider checksum selections in the lock file, rather than to terraform init -upgrade: The providers lock command can record provider package checksums for selected target platforms. The question concerns terraform init -upgrade acting to ask initialization to reconsider allowed provider selections, not a limit of terraform providers lock.

B:

The proposed warning belongs to required_providers source, which serves the different goal to identify the namespace and provider plugin that Terraform should install, rather than to terraform init -upgrade: The required_providers map supplies a provider source address such as hashicorp/aws for dependency resolution. The question concerns terraform init -upgrade acting to ask initialization to reconsider allowed provider selections, not a limit of required_providers source.

C:

The proposed warning belongs to Provider installation during init, which serves the different goal to download required plugins into the initialized working environment, rather than to terraform init -upgrade: terraform init resolves provider dependencies and installs or reuses selected plugin packages. The question concerns terraform init -upgrade acting to ask initialization to reconsider allowed provider selections, not a limit of Provider installation during init.

E:

The proposed warning belongs to Provider version compatibility operator, which serves the different goal to allow only nonbreaking versions in a specified range, rather than to terraform init -upgrade: A constraint like ~> 5.2 permits compatible versions within that bound while excluding the next incompatible major range. The question concerns terraform init -upgrade acting to ask initialization to reconsider allowed provider selections, not a limit of Provider version compatibility operator.

Question 158

A configuration walkthrough identifies "Local backend and shared CI". Which task is it principally intended to support?

  1. prevent unauthorized reading of saved infrastructure metadata
  2. distinguish state of different local Terraform workspaces
  3. choose a particular path for a locally stored Terraform state file
  4. keep a standalone project's state on its local filesystem
  5. retain a prior state snapshot while modifying local state
  6. avoid using workstation files as the source of truth for team deployments

Explanation

Correct Answer

F:

The practical result of Local backend and shared CI, used to avoid using workstation files as the source of truth for team deployments, is: Local state is best suited to isolated or experimental work rather than competing team runners. A qualification for this effect is: Copying a state file between computers is error-prone and can leak secrets.

Incorrect Answers

A:

That outcome applies to Local state access controls, intended to prevent unauthorized reading of saved infrastructure metadata, rather than the question's feature Local backend and shared CI: Filesystem permissions and secure workstation handling matter when state stays local. Unlike Local state access controls, Local backend and shared CI is intended to avoid using workstation files as the source of truth for team deployments, not to prevent unauthorized reading of saved infrastructure metadata.

B:

That outcome applies to Local workspace state files, intended to distinguish state of different local Terraform workspaces, rather than the question's feature Local backend and shared CI: Non-default local workspace state snapshots can be kept in a terraform.tfstate.d structure. Unlike Local workspace state files, Local backend and shared CI is intended to avoid using workstation files as the source of truth for team deployments, not to distinguish state of different local Terraform workspaces.

C:

That outcome applies to Local backend configuration, intended to choose a particular path for a locally stored Terraform state file, rather than the question's feature Local backend and shared CI: The local backend supports a path setting to change where state is written. Unlike Local backend configuration, Local backend and shared CI is intended to avoid using workstation files as the source of truth for team deployments, not to choose a particular path for a locally stored Terraform state file.

D:

That outcome applies to Default local state storage, intended to keep a standalone project's state on its local filesystem, rather than the question's feature Local backend and shared CI: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Unlike Default local state storage, Local backend and shared CI is intended to avoid using workstation files as the source of truth for team deployments, not to keep a standalone project's state on its local filesystem.

E:

That outcome applies to Local state backup, intended to retain a prior state snapshot while modifying local state, rather than the question's feature Local backend and shared CI: Local state operations commonly create backup snapshots to aid recovery from mistakes. Unlike Local state backup, Local backend and shared CI is intended to avoid using workstation files as the source of truth for team deployments, not to retain a prior state snapshot while modifying local state.

Question 159

During an implementation review, a Terraform team encounters "Registry module version selection". Which purpose is associated with that mechanism?

  1. choose an explicit compatible release of a registry module
  2. reference a reusable Terraform module from a VCS repository
  3. select a Terraform module within a larger repository
  4. reuse a published module from the Terraform Registry
  5. use a chosen module branch, tag, or commit from a Git source
  6. load a reusable module from a directory in the same repository

Explanation

Correct Answer

A:

The practical result of Registry module version selection, used to choose an explicit compatible release of a registry module, is: The version argument on a registry module call constrains which published module release is installed. A qualification for this effect is: The version argument is not supported for arbitrary local path modules.

Incorrect Answers

B:

That outcome applies to Git-hosted module source, intended to reference a reusable Terraform module from a VCS repository, rather than the question's feature Registry module version selection: A git:: URL can fetch a module from a Git repository using supported source syntax. Unlike Git-hosted module source, Registry module version selection is intended to choose an explicit compatible release of a registry module, not to reference a reusable Terraform module from a VCS repository.

C:

That outcome applies to Module source subdirectory, intended to select a Terraform module within a larger repository, rather than the question's feature Registry module version selection: The double-slash syntax in supported remote sources identifies a module subdirectory within the downloaded package. Unlike Module source subdirectory, Registry module version selection is intended to choose an explicit compatible release of a registry module, not to select a Terraform module within a larger repository.

D:

That outcome applies to Public registry module source, intended to reuse a published module from the Terraform Registry, rather than the question's feature Registry module version selection: Registry source addresses identify published module packages by namespace, name, and provider. Unlike Public registry module source, Registry module version selection is intended to choose an explicit compatible release of a registry module, not to reuse a published module from the Terraform Registry.

E:

That outcome applies to Pinned Git module ref, intended to use a chosen module branch, tag, or commit from a Git source, rather than the question's feature Registry module version selection: A Git module source can use ?ref=... to select the intended revision. Unlike Pinned Git module ref, Registry module version selection is intended to choose an explicit compatible release of a registry module, not to use a chosen module branch, tag, or commit from a Git source.

F:

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 Registry module version selection: A source like ./modules/network points a module call at a local filesystem path. Unlike Local child module source, Registry module version selection is intended to choose an explicit compatible release of a registry module, not to load a reusable module from a directory in the same repository.

Question 160

A Terraform runbook describes the mechanism "HCP Terraform API-driven run". Which responsibility should a reviewer associate with it?

  1. start remote plans from connected version-control updates
  2. review a planned change in the HCP Terraform run interface before apply
  3. queue runs through an API integration instead of only direct Git events
  4. store workspace state centrally rather than on a personal machine
  5. isolate the state, variables, and run history for one managed infrastructure unit
  6. execute Terraform with network access to private environments

Explanation

Correct Answer

C:

The practical result of HCP Terraform API-driven run, used to queue runs through an API integration instead of only direct Git events, is: The HCP Terraform API can support workflows that upload configuration and trigger managed runs. A qualification for this effect is: An API workflow must still authenticate and choose the intended workspace.

Incorrect Answers

A:

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 HCP Terraform API-driven run: A VCS-connected workspace can queue runs when matching configuration changes are committed. Unlike VCS-driven HCP Terraform workflow, HCP Terraform API-driven run is intended to queue runs through an API integration instead of only direct Git events, not to start remote plans from connected version-control updates.

B:

That outcome applies to Remote run approval, intended to review a planned change in the HCP Terraform run interface before apply, rather than the question's feature HCP Terraform API-driven run: An HCP workspace can separate planning and apply confirmation for controlled changes. Unlike Remote run approval, HCP Terraform API-driven run is intended to queue runs through an API integration instead of only direct Git events, not to review a planned change in the HCP Terraform run interface before apply.

D:

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 HCP Terraform API-driven run: HCP Terraform manages workspace state snapshots with controlled access and history. Unlike HCP Terraform state storage, HCP Terraform API-driven run is intended to queue runs through an API integration instead of only direct Git events, not to store workspace state centrally rather than on a personal machine.

E:

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 HCP Terraform API-driven run: An HCP Terraform workspace organizes a Terraform run context with its own state and configuration connection. Unlike HCP Terraform workspace, HCP Terraform API-driven run is intended to queue runs through an API integration instead of only direct Git events, not to isolate the state, variables, and run history for one managed infrastructure unit.

F:

That outcome applies to HCP Terraform agent, intended to execute Terraform with network access to private environments, rather than the question's feature HCP Terraform API-driven run: An HCP Terraform agent can run work in an operator-controlled environment and connect to private resources. Unlike HCP Terraform agent, HCP Terraform API-driven run is intended to queue runs through an API integration instead of only direct Git events, not to execute Terraform with network access to private environments.

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