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

Question 30

A change proposal relies on Infrastructure as code definition for the task to represent desired infrastructure in reviewable configuration files. Which limitation specifically applies to it?

  1. Reviewing a plan is different from committing its effects to the remote system.
  2. Terraform Core does not hard-code each cloud service API.
  3. The configuration still needs a tool and credentials to change actual systems.
  4. The file alone does not reveal every live change made outside Terraform.

Explanation

Correct Answer

C:

For Infrastructure as code definition in the task to represent desired infrastructure in reviewable configuration files, the important caution is: The configuration still needs a tool and credentials to change actual systems. The reason this matters is its actual behavior: Infrastructure as code describes infrastructure through machine-readable files instead of relying only on manual console operations.

Incorrect Answers

A:

The proposed warning belongs to Infrastructure execution plan, which serves the different goal to preview the proposed actions before changing real resources, rather than to Infrastructure as code definition: A Terraform plan calculates proposed actions from configuration, state, providers, and current observations. The question concerns Infrastructure as code definition acting to represent desired infrastructure in reviewable configuration files, not a limit of Infrastructure execution plan.

B:

The proposed warning belongs to Infrastructure provider API, which serves the different goal to translate declarative resources into operations on a platform, rather than to Infrastructure as code definition: Provider plugins supply resource implementations and call remote APIs when Terraform reconciles infrastructure. The question concerns Infrastructure as code definition acting to represent desired infrastructure in reviewable configuration files, not a limit of Infrastructure provider API.

D:

The proposed warning belongs to Desired configuration, which serves the different goal to record intended infrastructure settings under version control, rather than to Infrastructure as code definition: Configuration expresses the operator's intended infrastructure and is the starting point for planning. The question concerns Infrastructure as code definition acting to represent desired infrastructure in reviewable configuration files, not a limit of Desired configuration.

Question 31

A change proposal relies on terraform import CLI for the task to bring a pre-existing remote object under a resource address in Terraform state. Which limitation specifically applies to it?

  1. The import command alone does not generate a complete root configuration.
  2. Import success alone does not prove the next apply is a no-op.
  3. The wrong account's credentials may fail even if an ID format looks valid.
  4. Generated HCL requires review and may include attributes needing cleanup.

Explanation

Correct Answer

A:

For terraform import CLI in the task to bring a pre-existing remote object under a resource address in Terraform state, the important caution is: The import command alone does not generate a complete root configuration. The reason this matters is its actual behavior: terraform import ADDRESS ID binds the specified remote object to a declared resource instance.

Incorrect Answers

B:

The proposed warning belongs to Import validation follow-up, which serves the different goal to run a plan after importing an object to check unexpected updates, rather than to terraform import CLI: A post-import plan reveals whether declared settings match the newly adopted remote object. The question concerns terraform import CLI acting to bring a pre-existing remote object under a resource address in Terraform state, not a limit of Import validation follow-up.

C:

The proposed warning belongs to Import under aliased provider, which serves the different goal to adopt a remote object from the correct account or region, rather than to terraform import CLI: The target resource's selected provider configuration determines how Terraform locates and reads the imported object. The question concerns terraform import CLI acting to bring a pre-existing remote object under a resource address in Terraform state, not a limit of Import under aliased provider.

D:

The proposed warning belongs to Generate import configuration where supported, which serves the different goal to use import planning support to help write resource HCL for an existing object, rather than to terraform import CLI: Terraform supports generating configuration with appropriate import workflows for certain imported resources. The question concerns terraform import CLI acting to bring a pre-existing remote object under a resource address in Terraform state, not a limit of Generate import configuration where supported.

Question 32

A team is adjusting its declarative infrastructure process to separate proposing infrastructure changes from authorizing them. Which mechanism most directly meets this particular need?

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

Explanation

Correct Answer

B:

The task is to separate proposing infrastructure changes from authorizing them; Collaborative review before apply directly supports that requirement: Teams can share configuration and review a Terraform plan before a privileged apply runs. Its relevant boundary is: Version control approval alone does not guarantee the exact reviewed plan is used.

Incorrect Answers

A:

Plan inspection checkpoint is designed to review planned deletion before permitting an irreversible action, whereas this task is to separate proposing infrastructure changes from authorizing them: A review of change symbols and affected addresses can reveal unexpected destroy or replacement operations. Against Collaborative review before apply, its limitation is: A green validation result cannot substitute for plan review.

C:

Write-plan-apply lifecycle is designed to follow the core workflow from configuration to deliberate execution, whereas this task is to separate proposing infrastructure changes from authorizing them: The core workflow involves writing configuration, initializing, planning, then applying intended changes. Against Collaborative review before apply, 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 separate proposing infrastructure changes from authorizing them: Terraform uses its dependency graph to schedule actions that have no ordering relationship. Against Collaborative review before apply, its limitation is: Concurrency still needs backend locking when several runs target the same state.

E:

Configuration change cycle is designed to modify desired resource arguments then inspect the resulting plan, whereas this task is to separate proposing infrastructure changes from authorizing them: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. Against Collaborative review before apply, its limitation is: Editing a file does not update the cloud before apply.

Question 33

A deployment design calls for a supported way to choose a particular path for a locally stored Terraform state file. Which mechanism most directly meets this particular need?

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

Explanation

Correct Answer

C:

The task is to choose a particular path for a locally stored Terraform state file; Local backend configuration directly supports that requirement: The local backend supports a path setting to change where state is written. Its relevant boundary is: A custom local path still resides on the operator's filesystem.

Incorrect Answers

A:

Local state access controls is designed to prevent unauthorized reading of saved infrastructure metadata, whereas this task is to choose a particular path for a locally stored Terraform state file: Filesystem permissions and secure workstation handling matter when state stays local. Against Local backend configuration, its limitation is: A local backend cannot by itself provide shared policy controls or central audit.

B:

Local workspace state files is designed to distinguish state of different local Terraform workspaces, whereas this task is to choose a particular path for a locally stored Terraform state file: Non-default local workspace state snapshots can be kept in a terraform.tfstate.d structure. Against Local backend configuration, its limitation is: Separate workspace state does not change the configuration code automatically.

D:

Local state backup is designed to retain a prior state snapshot while modifying local state, whereas this task is to choose a particular path for a locally stored Terraform state file: Local state operations commonly create backup snapshots to aid recovery from mistakes. Against Local backend configuration, its limitation is: A backup does not make concurrent state modifications safe.

E:

Default local state storage is designed to keep a standalone project's state on its local filesystem, whereas this task is to choose a particular path for a locally stored Terraform state file: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Against Local backend configuration, its limitation is: A local file does not provide multi-user remote collaboration guarantees.

Question 34

A design uses Data source block to look up an existing object to use its attributes without managing its lifecycle. Which qualification applies to the named mechanism?

  1. A lookup that finds no suitable object can fail rather than creating one.
  2. Reading does not transfer ownership to the consuming root module.
  3. The data block does not claim responsibility for creating the referenced object.
  4. It is not a read-only query against an object managed elsewhere.

Explanation

Correct Answer

C:

For Data source block in the task to look up an existing object to use its attributes without managing its lifecycle, the important caution is: The data block does not claim responsibility for creating the referenced object. The reason this matters is its actual behavior: A data block asks its provider to read information; its attributes can feed other expressions.

Incorrect Answers

A:

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 Data source block: Data source arguments let the provider identify an existing object, often by name or tags. The question concerns Data source block acting to look up an existing object to use its attributes without managing its lifecycle, not a limit of Data source lookup filters.

B:

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 Data source block: A data source reads a shared object if the provider configuration has permission to access it. The question concerns Data source block acting to look up an existing object to use its attributes without managing its lifecycle, not a limit of Read-only cross-account lookup.

D:

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 Data source block: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider. The question concerns Data source block acting to look up an existing object to use its attributes without managing its lifecycle, not a limit of Managed resource block.

Question 35

A platform engineering group needs to reuse a published module from the Terraform Registry. Which mechanism most directly meets this particular need?

  1. Public registry module source
  2. Git-hosted module source
  3. Local child module source
  4. Module source subdirectory

Explanation

Correct Answer

A:

The task is to reuse a published module from the Terraform Registry; Public registry module source directly supports that requirement: Registry source addresses identify published module packages by namespace, name, and provider. Its relevant boundary is: Review source quality and pin an appropriate version instead of assuming every module is vetted.

Incorrect Answers

B:

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

C:

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

D:

Module source subdirectory is designed to select a Terraform module within a larger repository, whereas this task is to reuse a published module from the Terraform Registry: The double-slash syntax in supported remote sources identifies a module subdirectory within the downloaded package. Against Public registry module source, its limitation is: The path suffix does not change provider plugin version selection.

Question 36

An engineer must update an existing Terraform workflow to start remote plans from connected version-control updates. Which mechanism most directly meets this particular need?

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

Explanation

Correct Answer

C:

The task is to start remote plans from connected version-control updates; VCS-driven HCP Terraform workflow directly supports that requirement: A VCS-connected workspace can queue runs when matching configuration changes are committed. Its relevant boundary is: Its workspace settings determine whether runs need approval or are automatically applied.

Incorrect Answers

A:

Remote run approval is designed to review a planned change in the HCP Terraform run interface before apply, whereas this task is to start remote plans from connected version-control updates: An HCP workspace can separate planning and apply confirmation for controlled changes. Against VCS-driven HCP Terraform workflow, its limitation is: A speculative plan from a pull request is not the same as an authorized apply run.

B:

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 start remote plans from connected version-control updates: The HCP Terraform API can support workflows that upload configuration and trigger managed runs. Against VCS-driven HCP Terraform workflow, its limitation is: An API workflow must still authenticate and choose the intended workspace.

D:

HCP Terraform agent is designed to execute Terraform with network access to private environments, whereas this task is to start remote plans from connected version-control updates: An HCP Terraform agent can run work in an operator-controlled environment and connect to private resources. Against VCS-driven HCP Terraform workflow, its limitation is: An agent requires setup and does not make inaccessible endpoints public.

Question 37

A Terraform rollout has two separate requirements: first, identify the namespace and provider plugin that Terraform should install; second, keep selected provider versions reproducible between runs. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use terraform providers lock; then use Terraform dependency lock file.
  2. First use Terraform dependency lock file; then use required_providers source.
  3. First use required_providers source; then use terraform init -upgrade.
  4. First use terraform init -upgrade; then use terraform providers lock.
  5. First use required_providers source; then use Terraform dependency lock file.

Explanation

Correct Answer

E:

The first requirement, to identify the namespace and provider plugin that Terraform should install, is handled by required_providers source: The required_providers map supplies a provider source address such as hashicorp/aws for dependency resolution. The second 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. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to identify the namespace and provider plugin that Terraform should install and keep selected provider versions reproducible between runs, 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; the actual requirements are identify the namespace and provider plugin that Terraform should install first and keep selected provider versions reproducible between runs second.

B:

For the requested tasks to identify the namespace and provider plugin that Terraform should install and keep selected provider versions reproducible between runs, the first candidate Terraform dependency lock file addresses keep selected provider versions reproducible between runs; the second candidate required_providers source addresses identify the namespace and provider plugin that Terraform should install. This mapping fails because the first mechanism primarily supports the task to keep selected provider versions reproducible between runs and the second mechanism primarily supports the task to identify the namespace and provider plugin that Terraform should install; the actual requirements are identify the namespace and provider plugin that Terraform should install first and keep selected provider versions reproducible between runs second.

C:

For the requested tasks to identify the namespace and provider plugin that Terraform should install and keep selected provider versions reproducible between runs, the first candidate required_providers source addresses identify the namespace and provider plugin that Terraform should install; the second candidate terraform init -upgrade addresses ask initialization to reconsider allowed provider selections. This mapping fails because the second mechanism primarily supports the task to ask initialization to reconsider allowed provider selections; the actual requirements are identify the namespace and provider plugin that Terraform should install first and keep selected provider versions reproducible between runs second.

D:

For the requested tasks to identify the namespace and provider plugin that Terraform should install and keep selected provider versions reproducible between runs, the first candidate terraform init -upgrade addresses ask initialization to reconsider allowed provider selections; 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 ask initialization to reconsider allowed provider selections and the second mechanism primarily supports the task to populate or update provider checksum selections in the lock file; the actual requirements are identify the namespace and provider plugin that Terraform should install first and keep selected provider versions reproducible between runs second.

Question 38

The implementation must both look up an existing object to use its attributes without managing its lifecycle and obtain a shared network identifier owned by a different deployment team. Which TWO mechanisms directly address these two separate requirements? Choose TWO.

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

Explanation

Correct Answers

B:

Among the paired tasks to look up an existing object to use its attributes without managing its lifecycle and obtain a shared network identifier owned by a different deployment team, Read-only cross-account lookup serves the requirement to obtain a shared network identifier owned by a different deployment team: A data source reads a shared object if the provider configuration has permission to access it. The other task must be covered by a separate mechanism.

E:

Among the paired tasks to look up an existing object to use its attributes without managing its lifecycle and obtain a shared network identifier owned by a different deployment team, Data source block serves the requirement to look up an existing object to use its attributes without managing its lifecycle: A data block asks its provider to read information; its attributes can feed other expressions. The other task must be covered by a separate mechanism.

Incorrect Answers

A:

The requirements are look up an existing object to use its attributes without managing its lifecycle and obtain a shared network identifier owned by a different deployment team, while Data source lookup filters supports the different task to identify a pre-existing infrastructure object using provider-supported search criteria: Data source arguments let the provider identify an existing object, often by name or tags. That capability is outside the two selected responsibilities.

C:

The requirements are look up an existing object to use its attributes without managing its lifecycle and obtain a shared network identifier owned by a different deployment team, while Managed resource block supports the different task to ask Terraform to create and maintain an infrastructure object: A resource block declares a managed object whose lifecycle Terraform reconciles through a provider. That capability is outside the two selected responsibilities.

D:

The requirements are look up an existing object to use its attributes without managing its lifecycle and obtain a shared network identifier owned by a different deployment team, while Resource type and local name supports the different task to distinguish a provider-defined resource kind from its Terraform address label: A resource block has both a resource type and local name, forming references like aws_vpc.main. That capability is outside the two selected responsibilities.

Question 39

A Terraform runbook describes the mechanism "Collaborative review before apply". Which responsibility should a reviewer associate with it?

  1. modify desired resource arguments then inspect the resulting plan
  2. allow independent resources to be managed concurrently within one run
  3. review planned deletion before permitting an irreversible action
  4. separate proposing infrastructure changes from authorizing them

Explanation

Correct Answer

D:

The practical result of Collaborative review before apply, used to separate proposing infrastructure changes from authorizing them, is: Teams can share configuration and review a Terraform plan before a privileged apply runs. A qualification for this effect is: Version control approval alone does not guarantee the exact reviewed plan is used.

Incorrect Answers

A:

That outcome applies to Configuration change cycle, intended to modify desired resource arguments then inspect the resulting plan, rather than the question's feature Collaborative review before apply: Editing HCL changes intended infrastructure and a new plan reveals proposed differences. Unlike Configuration change cycle, Collaborative review before apply is intended to separate proposing infrastructure changes from authorizing them, not to modify desired resource arguments then inspect the resulting plan.

B:

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 Collaborative review before apply: Terraform uses its dependency graph to schedule actions that have no ordering relationship. Unlike Dependency-aware parallelism, Collaborative review before apply is intended to separate proposing infrastructure changes from authorizing them, not to allow independent resources to be managed concurrently within one run.

C:

That outcome applies to Plan inspection checkpoint, intended to review planned deletion before permitting an irreversible action, rather than the question's feature Collaborative review before apply: A review of change symbols and affected addresses can reveal unexpected destroy or replacement operations. Unlike Plan inspection checkpoint, Collaborative review before apply is intended to separate proposing infrastructure changes from authorizing them, not to review planned deletion before permitting an irreversible action.

Question 40

During an implementation review, a Terraform team encounters "Local backend configuration". Which purpose is associated with that mechanism?

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

Explanation

Correct Answer

A:

The practical result of Local backend configuration, used to choose a particular path for a locally stored Terraform state file, is: The local backend supports a path setting to change where state is written. A qualification for this effect is: A custom local path still resides on the operator's filesystem.

Incorrect Answers

B:

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 configuration: Local state operations commonly create backup snapshots to aid recovery from mistakes. Unlike Local state backup, Local backend configuration is intended to choose a particular path for a locally stored Terraform state file, not to retain a prior state snapshot while modifying local state.

C:

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 configuration: Without a configured remote backend, Terraform ordinarily stores state locally in terraform.tfstate. Unlike Default local state storage, Local backend configuration is intended to choose a particular path for a locally stored Terraform state file, not to keep a standalone project's state on its local filesystem.

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 backend configuration: Non-default local workspace state snapshots can be kept in a terraform.tfstate.d structure. Unlike Local workspace state files, Local backend configuration is intended to choose a particular path for a locally stored Terraform state file, not to distinguish state of different local Terraform workspaces.

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