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

Question 120

For a new infrastructure repository, the team wants to modify desired resource arguments then inspect the resulting plan. Which mechanism most directly meets this particular need?

  1. Configuration change cycle
  2. Dependency-aware parallelism
  3. Collaborative review before apply
  4. Saved plan promotion
  5. Write-plan-apply lifecycle
  6. Plan refresh and graph evaluation

Explanation

Correct Answer

A:

The task is to modify desired resource arguments then inspect the resulting plan; Configuration change cycle directly supports that requirement: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. Its relevant boundary is: Editing a file does not update the cloud before apply.

Incorrect Answers

B:

Dependency-aware parallelism is designed to allow independent resources to be managed concurrently within one run, whereas this task is to modify desired resource arguments then inspect the resulting plan: Terraform uses its dependency graph to schedule actions that have no ordering relationship. Against Configuration change cycle, its limitation is: Concurrency still needs backend locking when several runs target the same state.

C:

Collaborative review before apply is designed to separate proposing infrastructure changes from authorizing them, whereas this task is to modify desired resource arguments then inspect the resulting plan: Teams can share configuration and review a Terraform plan before a privileged apply runs. Against Configuration change cycle, its limitation is: Version control approval alone does not guarantee the exact reviewed plan is used.

D:

Saved plan promotion is designed to apply the reviewed plan artifact rather than recomputing from changed inputs, whereas this task is to modify desired resource arguments then inspect the resulting plan: terraform plan -out creates a binary plan that terraform apply can execute by file name. Against Configuration change cycle, its limitation is: Saved plans may contain sensitive values and must be protected.

E:

Write-plan-apply lifecycle is designed to follow the core workflow from configuration to deliberate execution, whereas this task is to modify desired resource arguments then inspect the resulting plan: The core workflow involves writing configuration, initializing, planning, then applying intended changes. Against Configuration change cycle, its limitation is: Destroy and import are maintenance actions rather than steps in every routine run.

F:

Plan refresh and graph evaluation is designed to reason about dependencies before Terraform proposes remote operations, whereas this task is to modify desired resource arguments then inspect the resulting plan: Terraform evaluates configuration, state, and provider information to construct an action graph. Against Configuration change cycle, its limitation is: The graph is not simply a sequential list ordered by file line number.

Question 121

A configuration review identifies the need to prevent unauthorized reading of saved infrastructure metadata. Which mechanism most directly meets this particular need?

  1. Custom local state path
  2. Local state access controls
  3. Local backend and shared CI
  4. Local state backup

Explanation

Correct Answer

B:

The task is to prevent unauthorized reading of saved infrastructure metadata; Local state access controls directly supports that requirement: Filesystem permissions and secure workstation handling matter when state stays local. Its relevant boundary is: A local backend cannot by itself provide shared policy controls or central audit.

Incorrect Answers

A:

Custom local state path is designed to place an isolated sandbox state file away from another lab's state, whereas this task is to prevent unauthorized reading of saved infrastructure metadata: A local backend path can separate state storage from another configuration's snapshot. Against Local state access controls, its limitation is: State location alone does not separate permissions for remote provider resources.

C:

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 prevent unauthorized reading of saved infrastructure metadata: Local state is best suited to isolated or experimental work rather than competing team runners. Against Local state access controls, its limitation is: Copying a state file between computers is error-prone and can leak secrets.

D:

Local state backup is designed to retain a prior state snapshot while modifying local state, whereas this task is to prevent unauthorized reading of saved infrastructure metadata: Local state operations commonly create backup snapshots to aid recovery from mistakes. Against Local state access controls, its limitation is: A backup does not make concurrent state modifications safe.

Question 122

The rollout owner asks whether Resource attributes computed by provider is sufficient to consume an assigned ID only after the provider supplies it. Which limitation specifically concerns that mechanism?

  1. They should not be hard-coded when proper references are available.
  2. A lookup that finds no suitable object can fail rather than creating one.
  3. It is not a read-only query against an object managed elsewhere.
  4. The data block does not claim responsibility for creating the referenced object.

Explanation

Correct Answer

A:

For Resource attributes computed by provider in the task to consume an assigned ID only after the provider supplies it, the important caution is: They should not be hard-coded when proper references are available. The reason this matters is its actual behavior: Computed attributes are often unknown during planning and become available after the provider creates or reads an object.

Incorrect Answers

B:

The proposed warning belongs to Data source lookup filters, which serves the different goal to identify a pre-existing infrastructure object using provider-supported search criteria, rather than to Resource attributes computed by provider: Data source arguments let the provider identify an existing object, often by name or tags. The question concerns Resource attributes computed by provider acting to consume an assigned ID only after the provider supplies it, not a limit of Data source lookup filters.

C:

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 attributes computed by provider: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider. The question concerns Resource attributes computed by provider acting to consume an assigned ID only after the provider supplies it, not a limit of Managed resource block.

D:

The proposed warning belongs to Data source block, which serves the different goal to look up an existing object to use its attributes without managing its lifecycle, rather than to Resource attributes computed by provider: A data block asks its provider to read information; its attributes can feed other expressions. The question concerns Resource attributes computed by provider acting to consume an assigned ID only after the provider supplies it, not a limit of Data source block.

Question 123

A team is adjusting its declarative infrastructure process to use a chosen module branch, tag, or commit from a Git source. Which mechanism most directly meets this particular need?

  1. Module source subdirectory
  2. Module discovery in registry
  3. Registry module version selection
  4. Pinned Git module ref

Explanation

Correct Answer

D:

The task is to use a chosen module branch, tag, or commit from a Git source; Pinned Git module ref directly supports that requirement: A Git module source can use ?ref=... to select the intended revision. Its relevant boundary is: A floating branch can change over time and weaken reproducibility.

Incorrect Answers

A:

Module source subdirectory is designed to select a Terraform module within a larger repository, whereas this task is to use a chosen module branch, tag, or commit from a Git source: The double-slash syntax in supported remote sources identifies a module subdirectory within the downloaded package. Against Pinned Git module ref, its limitation is: The path suffix does not change provider plugin version selection.

B:

Module discovery in registry is designed to find documented reusable modules rather than copying configurations manually, whereas this task is to use a chosen module branch, tag, or commit from a Git source: The Terraform Registry and private module registries can publish modules with inputs and outputs. Against Pinned Git module ref, its limitation is: A published module can still depend on provider permissions and external objects.

C:

Registry module version selection is designed to choose an explicit compatible release of a registry module, whereas this task is to use a chosen module branch, tag, or commit from a Git source: The version argument on a registry module call constrains which published module release is installed. Against Pinned Git module ref, its limitation is: The version argument is not supported for arbitrary local path modules.

Question 124

Before continuing an infrastructure rollout, the operator must review a planned change in the HCP Terraform run interface before apply. Which mechanism most directly meets this particular need?

  1. HCP Terraform workspace
  2. HCP Terraform remote execution
  3. Remote run approval
  4. VCS-driven HCP Terraform workflow

Explanation

Correct Answer

C:

The task is to review a planned change in the HCP Terraform run interface before apply; Remote run approval directly supports that requirement: An HCP workspace can separate planning and apply confirmation for controlled changes. Its relevant boundary is: A speculative plan from a pull request is not the same as an authorized apply run.

Incorrect Answers

A:

HCP Terraform workspace is designed to isolate the state, variables, and run history for one managed infrastructure unit, whereas this task is to review a planned change in the HCP Terraform run interface before apply: An HCP Terraform workspace organizes a Terraform run context with its own state and configuration connection. Against Remote run approval, its limitation is: It is not identical to a local CLI workspace's implementation.

B:

HCP Terraform remote execution is designed to execute Terraform operations in a managed remote runtime, whereas this task is to review a planned change in the HCP Terraform run interface before apply: HCP Terraform can run plans and applies outside a developer's workstation under workspace controls. Against Remote run approval, its limitation is: Remote execution still needs provider credentials and connectivity.

D:

VCS-driven HCP Terraform workflow is designed to start remote plans from connected version-control updates, whereas this task is to review a planned change in the HCP Terraform run interface before apply: A VCS-connected workspace can queue runs when matching configuration changes are committed. Against Remote run approval, its limitation is: Its workspace settings determine whether runs need approval or are automatically applied.

Question 125

A Terraform rollout has two separate requirements: first, keep selected provider versions reproducible between runs; second, populate or update provider checksum selections in the lock file. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Provider version compatibility operator; then use terraform providers lock.
  2. First use Terraform dependency lock file; then use Provider installation during init.
  3. First use Terraform dependency lock file; then use terraform providers lock.
  4. First use terraform providers lock; then use Terraform dependency lock file.
  5. First use Provider installation during init; then use Provider version compatibility operator.

Explanation

Correct Answer

C:

The first requirement, to keep selected provider versions reproducible between runs, is handled by Terraform dependency lock file: The .terraform.lock.hcl file records resolved provider versions and checksums for repeatable installation. The second requirement, to populate or update provider checksum selections in the lock file, is handled by terraform providers lock: The providers lock command can record provider package checksums for selected target platforms. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to keep selected provider versions reproducible between runs and populate or update provider checksum selections in the lock file, the first candidate Provider version compatibility operator addresses allow only nonbreaking versions in a specified range; the second candidate terraform providers lock addresses populate or update provider checksum selections in the lock file. This mapping fails because the first mechanism primarily supports the task to allow only nonbreaking versions in a specified range; the actual requirements are keep selected provider versions reproducible between runs first and populate or update provider checksum selections in the lock file second.

B:

For the requested tasks to keep selected provider versions reproducible between runs and populate or update provider checksum selections in the lock file, the first candidate Terraform dependency lock file addresses keep selected provider versions reproducible between runs; the second candidate Provider installation during init addresses download required plugins into the initialized working environment. This mapping fails because the second mechanism primarily supports the task to download required plugins into the initialized working environment; the actual requirements are keep selected provider versions reproducible between runs first and populate or update provider checksum selections in the lock file second.

D:

For the requested tasks to keep selected provider versions reproducible between runs and populate or update provider checksum selections in the lock file, the first candidate terraform providers lock addresses populate or update provider checksum selections in the lock file; the second candidate Terraform dependency lock file addresses keep selected provider versions reproducible between runs. This mapping fails because the first mechanism primarily supports the task to populate or update provider checksum selections in the lock file and the second mechanism primarily supports the task to keep selected provider versions reproducible between runs; the actual requirements are keep selected provider versions reproducible between runs first and populate or update provider checksum selections in the lock file second.

E:

For the requested tasks to keep selected provider versions reproducible between runs and populate or update provider checksum selections in the lock file, the first candidate Provider installation during init addresses download required plugins into the initialized working environment; the second candidate Provider version compatibility operator addresses allow only nonbreaking versions in a specified range. This mapping fails because the first mechanism primarily supports the task to download required plugins into the initialized working environment and the second mechanism primarily supports the task to allow only nonbreaking versions in a specified range; the actual requirements are keep selected provider versions reproducible between runs first and populate or update provider checksum selections in the lock file second.

Question 126

A Terraform rollout has two separate requirements: first, consume an assigned ID only after the provider supplies it; second, ask Terraform to create and maintain an infrastructure object. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Resource attributes computed by provider; then use Data source block.
  2. First use Data source lookup filters; then use Managed resource block.
  3. First use Managed resource block; then use Resource attributes computed by provider.
  4. First use Resource attributes computed by provider; then use Managed resource block.
  5. First use Data source block; then use Data source lookup filters.

Explanation

Correct Answer

D:

The first requirement, to consume an assigned ID only after the provider supplies it, is handled by Resource attributes computed by provider: Computed attributes are often unknown during planning and become available after the provider creates or reads an object. The second requirement, to ask Terraform to create and maintain an infrastructure object, is handled by Managed resource block: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to consume an assigned ID only after the provider supplies it and ask Terraform to create and maintain an infrastructure object, the first candidate Resource attributes computed by provider addresses consume an assigned ID only after the provider supplies it; the second candidate Data source block addresses look up an existing object to use its attributes without managing its lifecycle. This mapping fails because the second mechanism primarily supports the task to look up an existing object to use its attributes without managing its lifecycle; the actual requirements are consume an assigned ID only after the provider supplies it first and ask Terraform to create and maintain an infrastructure object second.

B:

For the requested tasks to consume an assigned ID only after the provider supplies it and ask Terraform to create and maintain an infrastructure object, the first candidate Data source lookup filters addresses identify a pre-existing infrastructure object using provider-supported search criteria; the second candidate Managed resource block addresses ask Terraform to create and maintain an infrastructure object. This mapping fails because the first mechanism primarily supports the task to identify a pre-existing infrastructure object using provider-supported search criteria; the actual requirements are consume an assigned ID only after the provider supplies it first and ask Terraform to create and maintain an infrastructure object second.

C:

For the requested tasks to consume an assigned ID only after the provider supplies it and ask Terraform to create and maintain an infrastructure object, the first candidate Managed resource block addresses ask Terraform to create and maintain an infrastructure object; the second candidate Resource attributes computed by provider addresses consume an assigned ID only after the provider supplies it. This mapping fails because the first mechanism primarily supports the task to ask Terraform to create and maintain an infrastructure object and the second mechanism primarily supports the task to consume an assigned ID only after the provider supplies it; the actual requirements are consume an assigned ID only after the provider supplies it first and ask Terraform to create and maintain an infrastructure object second.

E:

For the requested tasks to consume an assigned ID only after the provider supplies it and ask Terraform to create and maintain an infrastructure object, the first candidate Data source block addresses look up an existing object to use its attributes without managing its lifecycle; the second candidate Data source lookup filters addresses identify a pre-existing infrastructure object using provider-supported search criteria. This mapping fails because the first mechanism primarily supports the task to look up an existing object to use its attributes without managing its lifecycle and the second mechanism primarily supports the task to identify a pre-existing infrastructure object using provider-supported search criteria; the actual requirements are consume an assigned ID only after the provider supplies it first and ask Terraform to create and maintain an infrastructure object second.

Question 127

An operator chooses the mechanism "Configuration change cycle" for a Terraform project. Which outcome should this choice support?

  1. apply the reviewed plan artifact rather than recomputing from changed inputs
  2. modify desired resource arguments then inspect the resulting plan
  3. follow the core workflow from configuration to deliberate execution
  4. reason about dependencies before Terraform proposes remote operations
  5. separate proposing infrastructure changes from authorizing them

Explanation

Correct Answer

B:

The practical result of Configuration change cycle, used to modify desired resource arguments then inspect the resulting plan, is: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. A qualification for this effect is: Editing a file does not update the cloud before apply.

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 Configuration change cycle: terraform plan -out creates a binary plan that terraform apply can execute by file name. Unlike Saved plan promotion, Configuration change cycle is intended to modify desired resource arguments then inspect the resulting plan, 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 Configuration change cycle: The core workflow involves writing configuration, initializing, planning, then applying intended changes. Unlike Write-plan-apply lifecycle, Configuration change cycle is intended to modify desired resource arguments then inspect the resulting plan, not to follow the core workflow from configuration to deliberate execution.

D:

That outcome applies to Plan refresh and graph evaluation, intended to reason about dependencies before Terraform proposes remote operations, rather than the question's feature Configuration change cycle: Terraform evaluates configuration, state, and provider information to construct an action graph. Unlike Plan refresh and graph evaluation, Configuration change cycle is intended to modify desired resource arguments then inspect the resulting plan, not to reason about dependencies before Terraform proposes remote operations.

E:

That outcome applies to Collaborative review before apply, intended to separate proposing infrastructure changes from authorizing them, rather than the question's feature Configuration change cycle: Teams can share configuration and review a Terraform plan before a privileged apply runs. Unlike Collaborative review before apply, Configuration change cycle is intended to modify desired resource arguments then inspect the resulting plan, not to separate proposing infrastructure changes from authorizing them.

Question 128

A team reviews the use of Local state access controls in Terraform 1.12. Which purpose matches its actual behavior?

  1. retain a prior state snapshot while modifying local state
  2. keep a standalone project's state on its local filesystem
  3. place an isolated sandbox state file away from another lab's state
  4. prevent unauthorized reading of saved infrastructure metadata
  5. avoid using workstation files as the source of truth for team deployments

Explanation

Correct Answer

D:

The practical result of Local state access controls, used to prevent unauthorized reading of saved infrastructure metadata, is: Filesystem permissions and secure workstation handling matter when state stays local. A qualification for this effect is: A local backend cannot by itself provide shared policy controls or central audit.

Incorrect Answers

A:

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 state access controls: Local state operations commonly create backup snapshots to aid recovery from mistakes. Unlike Local state backup, Local state access controls is intended to prevent unauthorized reading of saved infrastructure metadata, not to retain a prior state snapshot while modifying local state.

B:

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 access controls: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Unlike Default local state storage, Local state access controls is intended to prevent unauthorized reading of saved infrastructure metadata, not to keep a standalone project's state on its local filesystem.

C:

That outcome applies to Custom local state path, intended to place an isolated sandbox state file away from another lab's state, rather than the question's feature Local state access controls: A local backend path can separate state storage from another configuration's snapshot. Unlike Custom local state path, Local state access controls is intended to prevent unauthorized reading of saved infrastructure metadata, not to place an isolated sandbox state file away from another lab's state.

E:

That outcome applies to Local backend and shared CI, intended to avoid using workstation files as the source of truth for team deployments, rather than the question's feature Local state access controls: Local state is best suited to isolated or experimental work rather than competing team runners. Unlike Local backend and shared CI, Local state access controls is intended to prevent unauthorized reading of saved infrastructure metadata, not to avoid using workstation files as the source of truth for team deployments.

Question 129

A Terraform rollout has two separate requirements: first, describe one managed infrastructure object in a configuration; second, record intended infrastructure settings under version control. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Infrastructure execution plan; then use Infrastructure provider API.
  2. First use Terraform resource declaration; then use Desired configuration.
  3. First use Desired configuration; then use Terraform resource declaration.
  4. First use Infrastructure provider API; then use Desired configuration.
  5. First use Terraform resource declaration; then use Infrastructure execution plan.

Explanation

Correct Answer

B:

The first requirement, to describe one managed infrastructure object in a configuration, is handled by Terraform resource declaration: A resource block represents an object that Terraform will create, update, or destroy through a provider. The second requirement, to record intended infrastructure settings under version control, is handled by Desired configuration: Configuration expresses the operator's intended infrastructure and is the starting point for planning. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to describe one managed infrastructure object in a configuration and record intended infrastructure settings under version control, the first candidate Infrastructure execution plan addresses preview the proposed actions before changing real resources; the second candidate Infrastructure provider API addresses translate declarative resources into operations on a platform. This mapping fails because the first mechanism primarily supports the task to preview the proposed actions before changing real resources and the second mechanism primarily supports the task to translate declarative resources into operations on a platform; the actual requirements are describe one managed infrastructure object in a configuration first and record intended infrastructure settings under version control second.

C:

For the requested tasks to describe one managed infrastructure object in a configuration and record intended infrastructure settings under version control, the first candidate Desired configuration addresses record intended infrastructure settings under version control; the second candidate Terraform resource declaration addresses describe one managed infrastructure object in a configuration. This mapping fails because the first mechanism primarily supports the task to record intended infrastructure settings under version control and the second mechanism primarily supports the task to describe one managed infrastructure object in a configuration; the actual requirements are describe one managed infrastructure object in a configuration first and record intended infrastructure settings under version control second.

D:

For the requested tasks to describe one managed infrastructure object in a configuration and record intended infrastructure settings under version control, the first candidate Infrastructure provider API addresses translate declarative resources into operations on a platform; the second candidate Desired configuration addresses record intended infrastructure settings under version control. This mapping fails because the first mechanism primarily supports the task to translate declarative resources into operations on a platform; the actual requirements are describe one managed infrastructure object in a configuration first and record intended infrastructure settings under version control second.

E:

For the requested tasks to describe one managed infrastructure object in a configuration and record intended infrastructure settings under version control, the first candidate Terraform resource declaration addresses describe one managed infrastructure object in a configuration; the second candidate Infrastructure execution plan addresses preview the proposed actions before changing real resources. This mapping fails because the second mechanism primarily supports the task to preview the proposed actions before changing real resources; the actual requirements are describe one managed infrastructure object in a configuration first and record intended infrastructure settings under version control second.

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.

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