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

Question 90

An engineer must update an existing Terraform workflow to apply the reviewed plan artifact rather than recomputing from changed inputs. Which mechanism most directly meets this particular need?

  1. Configuration change cycle
  2. Saved plan promotion
  3. Write-plan-apply lifecycle
  4. Dependency-aware parallelism
  5. Plan inspection checkpoint

Explanation

Correct Answer

B:

The task is to apply the reviewed plan artifact rather than recomputing from changed inputs; Saved plan promotion directly supports that requirement: terraform plan -out creates a binary plan that terraform apply can execute by file name. Its relevant boundary is: Saved plans may contain sensitive values and must be protected.

Incorrect Answers

A:

Configuration change cycle is designed to modify desired resource arguments then inspect the resulting plan, whereas this task is to apply the reviewed plan artifact rather than recomputing from changed inputs: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. Against Saved plan promotion, its limitation is: Editing a file does not update the cloud before apply.

C:

Write-plan-apply lifecycle is designed to follow the core workflow from configuration to deliberate execution, whereas this task is to apply the reviewed plan artifact rather than recomputing from changed inputs: The core workflow involves writing configuration, initializing, planning, then applying intended changes. Against Saved plan promotion, its limitation is: Destroy and import are maintenance actions rather than steps in every routine run.

D:

Dependency-aware parallelism is designed to allow independent resources to be managed concurrently within one run, whereas this task is to apply the reviewed plan artifact rather than recomputing from changed inputs: Terraform uses its dependency graph to schedule actions that have no ordering relationship. Against Saved plan promotion, its limitation is: Concurrency still needs backend locking when several runs target the same state.

E:

Plan inspection checkpoint is designed to review planned deletion before permitting an irreversible action, whereas this task is to apply the reviewed plan artifact rather than recomputing from changed inputs: A review of change symbols and affected addresses can reveal unexpected destroy or replacement operations. Against Saved plan promotion, its limitation is: A green validation result cannot substitute for plan review.

Question 91

A platform engineering group needs to keep selected provider versions reproducible between runs. Which mechanism most directly meets this particular need?

  1. required_providers source
  2. Provider version constraint
  3. Terraform dependency lock file
  4. terraform providers lock

Explanation

Correct Answer

C:

The task is to keep selected provider versions reproducible between runs; Terraform dependency lock file directly supports that requirement: The .terraform.lock.hcl file records resolved provider versions and checksums for repeatable installation. Its relevant boundary is: It does not lock child module versions or Terraform Core versions.

Incorrect Answers

A:

required_providers source is designed to identify the namespace and provider plugin that Terraform should install, whereas this task is to keep selected provider versions reproducible between runs: The required_providers map supplies a provider source address such as hashicorp/aws for dependency resolution. Against Terraform dependency lock file, its limitation is: A provider block configures an installed provider instance rather than declaring its source.

B:

Provider version constraint is designed to restrict acceptable versions of an infrastructure provider, whereas this task is to keep selected provider versions reproducible between runs: The version argument in required_providers expresses allowed provider versions, such as a compatible release series. Against Terraform dependency lock file, its limitation is: The constraint is not the same as Terraform CLI required_version.

D:

terraform providers lock addresses the different requirement to populate or update provider checksum selections in the lock file: The providers lock command can record provider package checksums for selected target platforms; this does not by itself satisfy the requested task to keep selected provider versions reproducible between runs. For the stated need, Terraform dependency lock file is the more direct mechanism.

Question 92

For a new infrastructure repository, the team wants to retain a prior state snapshot while modifying local state. Which mechanism most directly meets this particular need?

  1. Default local state storage
  2. Local state backup
  3. Local workspace state files
  4. Local backend configuration
  5. Local state access controls
  6. Local backend and shared CI

Explanation

Correct Answer

B:

The task is to retain a prior state snapshot while modifying local state; Local state backup directly supports that requirement: Local state operations commonly create backup snapshots to aid recovery from mistakes. Its relevant boundary is: A backup does not make concurrent state modifications safe.

Incorrect Answers

A:

Default local state storage is designed to keep a standalone project's state on its local filesystem, whereas this task is to retain a prior state snapshot while modifying local state: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Against Local state backup, its limitation is: A local file does not provide multi-user remote collaboration guarantees.

C:

Local workspace state files is designed to distinguish state of different local Terraform workspaces, whereas this task is to retain a prior state snapshot while modifying local state: Non-default local workspace state snapshots can be kept in a terraform.tfstate.d structure. Against Local state backup, its limitation is: Separate workspace state does not change the configuration code automatically.

D:

Local backend configuration is designed to choose a particular path for a locally stored Terraform state file, whereas this task is to retain a prior state snapshot while modifying local state: The local backend supports a path setting to change where state is written. Against Local state backup, its limitation is: A custom local path still resides on the operator's filesystem.

E:

Local state access controls is designed to prevent unauthorized reading of saved infrastructure metadata, whereas this task is to retain a prior state snapshot while modifying local state: Filesystem permissions and secure workstation handling matter when state stays local. Against Local state backup, its limitation is: A local backend cannot by itself provide shared policy controls or central audit.

F:

Local backend and shared CI is designed to avoid using workstation files as the source of truth for team deployments, whereas this task is to retain a prior state snapshot while modifying local state: Local state is best suited to isolated or experimental work rather than competing team runners. Against Local state backup, its limitation is: Copying a state file between computers is error-prone and can leak secrets.

Question 93

A reviewer is asked to choose a mechanism to select a Terraform module within a larger repository. Which mechanism most directly meets this particular need?

  1. Local child module source
  2. Module source subdirectory
  3. Public registry module source
  4. Pinned Git module ref

Explanation

Correct Answer

B:

The task is to select a Terraform module within a larger repository; Module source subdirectory directly supports that requirement: The double-slash syntax in supported remote sources identifies a module subdirectory within the downloaded package. Its relevant boundary is: The path suffix does not change provider plugin version selection.

Incorrect Answers

A:

Local child module source is designed to load a reusable module from a directory in the same repository, whereas this task is to select a Terraform module within a larger repository: A source like ./modules/network points a module call at a local filesystem path. Against Module source subdirectory, its limitation is: Local module paths do not use registry module version arguments.

C:

Public registry module source is designed to reuse a published module from the Terraform Registry, whereas this task is to select a Terraform module within a larger repository: Registry source addresses identify published module packages by namespace, name, and provider. Against Module source subdirectory, its limitation is: Review source quality and pin an appropriate version instead of assuming every module is vetted.

D:

Pinned Git module ref addresses the different requirement to use a chosen module branch, tag, or commit from a Git source: A Git module source can use ?ref=... to select the intended revision; this does not by itself satisfy the requested task to select a Terraform module within a larger repository. For the stated need, Module source subdirectory is the more direct mechanism.

Question 94

A configuration review identifies the need to store workspace state centrally rather than on a personal machine. Which mechanism most directly meets this particular need?

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

Explanation

Correct Answer

B:

The task is to store workspace state centrally rather than on a personal machine; HCP Terraform state storage directly supports that requirement: HCP Terraform manages workspace state snapshots with controlled access and history. Its relevant boundary is: Central state storage does not guarantee infrastructure can be reached from every execution mode.

Incorrect Answers

A:

HCP Terraform agent is designed to execute Terraform with network access to private environments, whereas this task is to store workspace state centrally rather than on a personal machine: An HCP Terraform agent can run work in an operator-controlled environment and connect to private resources. Against HCP Terraform state storage, 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 store workspace state centrally rather than on a personal machine: An HCP workspace can separate planning and apply confirmation for controlled changes. Against HCP Terraform state storage, its limitation is: A speculative plan from a pull request is not the same as an authorized apply run.

D:

HCP Terraform API-driven run is designed to queue runs through an API integration instead of only direct Git events, whereas this task is to store workspace state centrally rather than on a personal machine: The HCP Terraform API can support workflows that upload configuration and trigger managed runs. Against HCP Terraform state storage, its limitation is: An API workflow must still authenticate and choose the intended workspace.

Question 95

A team reviews the use of Resource type and local name in Terraform 1.12. Which purpose matches its actual behavior?

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

Explanation

Correct Answer

C:

The practical result of Resource type and local name, used to distinguish a provider-defined resource kind from its Terraform address label, is: A resource block has both a resource type and local name, forming references like aws_vpc.main. A qualification for this effect is: Changing the local name can change the state address unless migrated.

Incorrect Answers

A:

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 Resource type and local name: Computed attributes are often unknown during planning and become available after the provider creates or reads an object. Unlike Resource attributes computed by provider, Resource type and local name is intended to distinguish a provider-defined resource kind from its Terraform address label, not to consume an assigned ID only after the provider supplies it.

B:

That outcome applies to Managed resource block, intended to ask Terraform to create and maintain an infrastructure object, rather than the question's feature Resource type and local name: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider. Unlike Managed resource block, Resource type and local name is intended to distinguish a provider-defined resource kind from its Terraform address label, not to ask Terraform to create and maintain an infrastructure object.

D:

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 Resource type and local name: A data source reads a shared object if the provider configuration has permission to access it. Unlike Read-only cross-account lookup, Resource type and local name is intended to distinguish a provider-defined resource kind from its Terraform address label, not to obtain a shared network identifier owned by a different deployment team.

E:

That outcome applies to Data source dependency scheduling, intended to defer a read when its arguments depend on a resource still being created, rather than the question's feature Resource type and local name: Terraform tracks references to determine whether a data-source read can run during planning or must wait. Unlike Data source dependency scheduling, Resource type and local name is intended to distinguish a provider-defined resource kind from its Terraform address label, not to defer a read when its arguments depend on a resource still being created.

Question 96

A team is adjusting its declarative infrastructure process to describe one managed infrastructure object in a configuration. Which mechanism most directly meets this particular need?

  1. Infrastructure execution plan
  2. Desired configuration
  3. Terraform resource declaration
  4. Infrastructure provider API

Explanation

Correct Answer

C:

The task is to describe one managed infrastructure object in a configuration; Terraform resource declaration directly supports that requirement: A resource block represents an object that Terraform will create, update, or destroy through a provider. Its relevant boundary is: A resource declaration is not the same as a read-only data lookup.

Incorrect Answers

A:

Infrastructure execution plan is designed to preview the proposed actions before changing real resources, whereas this task is to describe one managed infrastructure object in a configuration: A Terraform plan calculates proposed actions from configuration, state, providers, and current observations. Against Terraform resource declaration, its limitation is: Reviewing a plan is different from committing its effects to the remote system.

B:

Desired configuration is designed to record intended infrastructure settings under version control, whereas this task is to describe one managed infrastructure object in a configuration: Configuration expresses the operator's intended infrastructure and is the starting point for planning. Against Terraform resource declaration, its limitation is: The file alone does not reveal every live change made outside Terraform.

D:

Infrastructure provider API is designed to translate declarative resources into operations on a platform, whereas this task is to describe one managed infrastructure object in a configuration: Provider plugins supply resource implementations and call remote APIs when Terraform reconciles infrastructure. Against Terraform resource declaration, its limitation is: Terraform Core does not hard-code each cloud service API.

Question 97

In a reusable deployment, the primary objective is to map a discovered object to the intended Terraform resource instance address. Which mechanism most directly meets this particular need?

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

Explanation

Correct Answer

B:

The task is to map a discovered object to the intended Terraform resource instance address; Import resource address matching directly supports that requirement: Import uses a Terraform resource address that corresponds to the configuration intended to manage the object. Its relevant boundary is: A remote object ID is not interchangeable with the Terraform address.

Incorrect Answers

A:

Generate import configuration where supported is designed to use import planning support to help write resource HCL for an existing object, whereas this task is to map a discovered object to the intended Terraform resource instance address: Terraform supports generating configuration with appropriate import workflows for certain imported resources. Against Import resource address matching, its limitation is: Generated HCL requires review and may include attributes needing cleanup.

C:

Import under aliased provider is designed to adopt a remote object from the correct account or region, whereas this task is to map a discovered object to the intended Terraform resource instance address: The target resource's selected provider configuration determines how Terraform locates and reads the imported object. Against Import resource address matching, its limitation is: The wrong account's credentials may fail even if an ID format looks valid.

D:

Import validation follow-up is designed to run a plan after importing an object to check unexpected updates, whereas this task is to map a discovered object to the intended Terraform resource instance address: A post-import plan reveals whether declared settings match the newly adopted remote object. Against Import resource address matching, its limitation is: Import success alone does not prove the next apply is a no-op.

Question 98

A colleague recommends the Terraform concept "Saved plan promotion". Which use case best matches it?

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

Explanation

Correct Answer

D:

The practical result of Saved plan promotion, used to apply the reviewed plan artifact rather than recomputing from changed inputs, is: terraform plan -out creates a binary plan that terraform apply can execute by file name. A qualification for this effect is: Saved plans may contain sensitive values and must be protected.

Incorrect Answers

A:

That outcome applies to Plan inspection checkpoint, intended to review planned deletion before permitting an irreversible action, rather than the question's feature Saved plan promotion: A review of change symbols and affected addresses can reveal unexpected destroy or replacement operations. Unlike Plan inspection checkpoint, Saved plan promotion is intended to apply the reviewed plan artifact rather than recomputing from changed inputs, not to review planned deletion before permitting an irreversible action.

B:

That outcome applies to Configuration change cycle, intended to modify desired resource arguments then inspect the resulting plan, rather than the question's feature Saved plan promotion: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. Unlike Configuration change cycle, Saved plan promotion is intended to apply the reviewed plan artifact rather than recomputing from changed inputs, not to modify desired resource arguments then inspect the resulting plan.

C:

That outcome applies to Dependency-aware parallelism, intended to allow independent resources to be managed concurrently within one run, rather than the question's feature Saved plan promotion: Terraform uses its dependency graph to schedule actions that have no ordering relationship. Unlike Dependency-aware parallelism, Saved plan promotion is intended to apply the reviewed plan artifact rather than recomputing from changed inputs, not to allow independent resources to be managed concurrently within one run.

E:

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 Saved plan promotion: The core workflow involves writing configuration, initializing, planning, then applying intended changes. Unlike Write-plan-apply lifecycle, Saved plan promotion is intended to apply the reviewed plan artifact rather than recomputing from changed inputs, not to follow the core workflow from configuration to deliberate execution.

Question 99

An operator chooses the mechanism "Local state backup" for a Terraform project. Which outcome should this choice support?

  1. keep a standalone project's state on its local filesystem
  2. choose a particular path for a locally stored Terraform state file
  3. prevent unauthorized reading of saved infrastructure metadata
  4. distinguish state of different local Terraform workspaces
  5. retain a prior state snapshot while modifying local state

Explanation

Correct Answer

E:

The practical result of Local state backup, used to retain a prior state snapshot while modifying local state, is: Local state operations commonly create backup snapshots to aid recovery from mistakes. A qualification for this effect is: A backup does not make concurrent state modifications safe.

Incorrect Answers

A:

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 state backup: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Unlike Default local state storage, Local state backup is intended to retain a prior state snapshot while modifying local state, not to keep a standalone project's state on its local filesystem.

B:

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 state backup: The local backend supports a path setting to change where state is written. Unlike Local backend configuration, Local state backup is intended to retain a prior state snapshot while modifying local state, not to choose a particular path for a locally stored Terraform state file.

C:

That outcome applies to Local state access controls, intended to prevent unauthorized reading of saved infrastructure metadata, rather than the question's feature Local state backup: Filesystem permissions and secure workstation handling matter when state stays local. Unlike Local state access controls, Local state backup is intended to retain a prior state snapshot while modifying local state, not to prevent unauthorized reading of saved infrastructure metadata.

D:

That outcome applies to Local workspace state files, intended to distinguish state of different local Terraform workspaces, rather than the question's feature Local state backup: Non-default local workspace state snapshots can be kept in a terraform.tfstate.d structure. Unlike Local workspace state files, Local state backup is intended to retain a prior state snapshot while modifying local state, not to distinguish state of different local Terraform workspaces.

Question 100

Before adopting Resource type and local name to distinguish a provider-defined resource kind from its Terraform address label, which statement sets an accurate boundary?

  1. It is not a read-only query against an object managed elsewhere.
  2. They should not be hard-coded when proper references are available.
  3. A data source does not automatically establish ownership over the queried object.
  4. Reading does not transfer ownership to the consuming root module.
  5. Changing the local name can change the state address unless migrated.

Explanation

Correct Answer

E:

For Resource type and local name in the task to distinguish a provider-defined resource kind from its Terraform address label, the important caution is: Changing the local name can change the state address unless migrated. The reason this matters is its actual behavior: A resource block has both a resource type and local name, forming references like aws_vpc.main.

Incorrect Answers

A:

The proposed warning belongs to Managed resource block, which serves the different goal to ask Terraform to create and maintain an infrastructure object, rather than to Resource type and local name: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider. The question concerns Resource type and local name acting to distinguish a provider-defined resource kind from its Terraform address label, not a limit of Managed resource block.

B:

The proposed warning belongs to Resource attributes computed by provider, which serves the different goal to consume an assigned ID only after the provider supplies it, rather than to Resource type and local name: Computed attributes are often unknown during planning and become available after the provider creates or reads an object. The question concerns Resource type and local name acting to distinguish a provider-defined resource kind from its Terraform address label, not a limit of Resource attributes computed by provider.

C:

The proposed warning belongs to Data source dependency scheduling, which serves the different goal to defer a read when its arguments depend on a resource still being created, rather than to Resource type and local name: Terraform tracks references to determine whether a data-source read can run during planning or must wait. The question concerns Resource type and local name acting to distinguish a provider-defined resource kind from its Terraform address label, not a limit of Data source dependency scheduling.

D:

The proposed warning belongs to Read-only cross-account lookup, which serves the different goal to obtain a shared network identifier owned by a different deployment team, rather than to Resource type and local name: A data source reads a shared object if the provider configuration has permission to access it. The question concerns Resource type and local name acting to distinguish a provider-defined resource kind from its Terraform address label, not a limit of Read-only cross-account lookup.

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