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

Question 480

A team reviews the use of Backend partial configuration in Terraform 1.12. Which purpose matches its actual behavior?

  1. consume published output values from another Terraform state where supported
  2. supply backend settings during init rather than hardcoding all values
  3. move an existing state history when switching remote storage
  4. set backend storage for a root execution rather than independently in each child module

Explanation

Correct Answer

B:

The practical result of Backend partial configuration, used to supply backend settings during init rather than hardcoding all values, is: terraform init -backend-config can fill supported backend settings supplied outside checked-in files. A qualification for this effect is: Credentials may still leak if stored in a plan or command history; prefer secure credential flows.

Incorrect Answers

A:

That outcome applies to Data source for remote state outputs, intended to consume published output values from another Terraform state where supported, rather than the question's feature Backend partial configuration: terraform_remote_state exposes root output values from a compatible existing state snapshot. Unlike Data source for remote state outputs, Backend partial configuration is intended to supply backend settings during init rather than hardcoding all values, not to consume published output values from another Terraform state where supported.

C:

That outcome applies to Backend migration workflow, intended to move an existing state history when switching remote storage, rather than the question's feature Backend partial configuration: terraform init -migrate-state supports moving state during an intentional backend change. Unlike Backend migration workflow, Backend partial configuration is intended to supply backend settings during init rather than hardcoding all values, not to move an existing state history when switching remote storage.

D:

That outcome applies to Backend configuration is root-only, intended to set backend storage for a root execution rather than independently in each child module, rather than the question's feature Backend partial configuration: The active root module configures the backend used by that Terraform working directory. Unlike Backend configuration is root-only, Backend partial configuration is intended to supply backend settings during init rather than hardcoding all values, not to set backend storage for a root execution rather than independently in each child module.

Question 481

A Terraform rollout has two separate requirements: first, replace repetitive click-by-click resource deployment with a pipeline; second, identify likely creations, updates, and deletions before execution. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Self-documenting resource relationships; then use Version-controlled configuration history.
  2. First use Change impact preview; then use Automated provisioning pipeline.
  3. First use Version-controlled configuration history; then use Change impact preview.
  4. First use Automated provisioning pipeline; then use Self-documenting resource relationships.
  5. First use Automated provisioning pipeline; then use Change impact preview.

Explanation

Correct Answer

E:

The first requirement, to replace repetitive click-by-click resource deployment with a pipeline, is handled by Automated provisioning pipeline: A CI pipeline can run validation and planning before an authorized apply, reducing procedural inconsistency. The second requirement, to identify likely creations, updates, and deletions before execution, is handled by Change impact preview: Terraform planning exposes proposed operations for examination before they take effect. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to replace repetitive click-by-click resource deployment with a pipeline and identify likely creations, updates, and deletions before execution, the first candidate Self-documenting resource relationships addresses make infrastructure dependencies understandable from code; the second candidate Version-controlled configuration history addresses trace why infrastructure definitions changed. This mapping fails because the first mechanism primarily supports the task to make infrastructure dependencies understandable from code and the second mechanism primarily supports the task to trace why infrastructure definitions changed; the actual requirements are replace repetitive click-by-click resource deployment with a pipeline first and identify likely creations, updates, and deletions before execution second.

B:

For the requested tasks to replace repetitive click-by-click resource deployment with a pipeline and identify likely creations, updates, and deletions before execution, the first candidate Change impact preview addresses identify likely creations, updates, and deletions before execution; the second candidate Automated provisioning pipeline addresses replace repetitive click-by-click resource deployment with a pipeline. This mapping fails because the first mechanism primarily supports the task to identify likely creations, updates, and deletions before execution and the second mechanism primarily supports the task to replace repetitive click-by-click resource deployment with a pipeline; the actual requirements are replace repetitive click-by-click resource deployment with a pipeline first and identify likely creations, updates, and deletions before execution second.

C:

For the requested tasks to replace repetitive click-by-click resource deployment with a pipeline and identify likely creations, updates, and deletions before execution, the first candidate Version-controlled configuration history addresses trace why infrastructure definitions changed; the second candidate Change impact preview addresses identify likely creations, updates, and deletions before execution. This mapping fails because the first mechanism primarily supports the task to trace why infrastructure definitions changed; the actual requirements are replace repetitive click-by-click resource deployment with a pipeline first and identify likely creations, updates, and deletions before execution second.

D:

For the requested tasks to replace repetitive click-by-click resource deployment with a pipeline and identify likely creations, updates, and deletions before execution, the first candidate Automated provisioning pipeline addresses replace repetitive click-by-click resource deployment with a pipeline; the second candidate Self-documenting resource relationships addresses make infrastructure dependencies understandable from code. This mapping fails because the second mechanism primarily supports the task to make infrastructure dependencies understandable from code; the actual requirements are replace repetitive click-by-click resource deployment with a pipeline first and identify likely creations, updates, and deletions before execution second.

Question 482

A Terraform runbook describes the mechanism "Module count meta-argument". Which responsibility should a reviewer associate with it?

  1. attach an explicitly selected provider configuration to child module resources
  2. keep implementation resources private while exposing a stable input and output interface
  3. preserve resource identity when a configuration resource is moved into a module
  4. optionally instantiate a module based on a count expression

Explanation

Correct Answer

D:

The practical result of Module count meta-argument, used to optionally instantiate a module based on a count expression, is: count on a module block creates zero or more indexed module instances. A qualification for this effect is: Count-based addressing is positional and differs from for_each keys.

Incorrect Answers

A:

That outcome applies to Module provider passing, intended to attach an explicitly selected provider configuration to child module resources, rather than the question's feature Module count meta-argument: The providers map lets a module receive the provider instance the caller intends. Unlike Module provider passing, Module count meta-argument is intended to optionally instantiate a module based on a count expression, not to attach an explicitly selected provider configuration to child module resources.

B:

That outcome applies to Module encapsulation, intended to keep implementation resources private while exposing a stable input and output interface, rather than the question's feature Module count meta-argument: Modules promote reuse by letting callers depend on documented variables and outputs rather than every internal block. Unlike Module encapsulation, Module count meta-argument is intended to optionally instantiate a module based on a count expression, not to keep implementation resources private while exposing a stable input and output interface.

C:

That outcome applies to Module refactor with moved block, intended to preserve resource identity when a configuration resource is moved into a module, rather than the question's feature Module count meta-argument: A moved block can map an old resource address to a new module resource address for state-aware refactoring. Unlike Module refactor with moved block, Module count meta-argument is intended to optionally instantiate a module based on a count expression, not to preserve resource identity when a configuration resource is moved into a module.

Question 483

A configuration walkthrough identifies "Workspace variable isolation". Which task is it principally intended to support?

  1. delegate a set of workspaces without granting broad organization-wide rights
  2. organize related workspaces and manage project-level access controls
  3. give development and production separate credentials and deployment values
  4. queue a downstream workspace run when an upstream workspace completes a successful apply

Explanation

Correct Answer

C:

The practical result of Workspace variable isolation, used to give development and production separate credentials and deployment values, is: Distinct workspaces separate their state and input variables even when they use similar configuration. A qualification for this effect is: Shared variable sets need appropriate scoping to avoid accidental cross-environment access.

Incorrect Answers

A:

That outcome applies to Project-level team access, intended to delegate a set of workspaces without granting broad organization-wide rights, rather than the question's feature Workspace variable isolation: Project-scoped team permissions help control who can manage associated workspaces. Unlike Project-level team access, Workspace variable isolation is intended to give development and production separate credentials and deployment values, not to delegate a set of workspaces without granting broad organization-wide rights.

B:

That outcome applies to HCP Terraform project grouping, intended to organize related workspaces and manage project-level access controls, rather than the question's feature Workspace variable isolation: Projects group HCP Terraform workspaces so teams can delegate organization and access by project. Unlike HCP Terraform project grouping, Workspace variable isolation is intended to give development and production separate credentials and deployment values, not to organize related workspaces and manage project-level access controls.

D:

The outcome in this option belongs to HCP Terraform run triggers: Run triggers support a controlled dependency workflow between HCP Terraform workspaces; by contrast, the feature actually named in the stem, Workspace variable isolation, has a distinct purpose: to give development and production separate credentials and deployment values.

Question 484

A Terraform rollout has two separate requirements: first, export state or saved plan information in machine-readable form; second, display declared root output values from the current state. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Address filter for state list; then use terraform state list.
  2. First use terraform output; then use terraform show -json.
  3. First use terraform state list; then use terraform output.
  4. First use terraform show -json; then use terraform output.
  5. First use terraform show -json; then use Address filter for state list.

Explanation

Correct Answer

D:

The first requirement, to export state or saved plan information in machine-readable form, is handled by terraform show -json: show -json emits detailed JSON for supported state and plan representations. The second requirement, to display declared root output values from the current state, is handled by terraform output: output reads named output values and can provide -json for structured automation. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to export state or saved plan information in machine-readable form and display declared root output values from the current state, the first candidate Address filter for state list addresses locate a relevant module or resource without reading every tracked address; the second candidate terraform state list addresses enumerate Terraform resource addresses currently tracked in a state snapshot. This mapping fails because the first mechanism primarily supports the task to locate a relevant module or resource without reading every tracked address and the second mechanism primarily supports the task to enumerate Terraform resource addresses currently tracked in a state snapshot; the actual requirements are export state or saved plan information in machine-readable form first and display declared root output values from the current state second.

B:

For the requested tasks to export state or saved plan information in machine-readable form and display declared root output values from the current state, the first candidate terraform output addresses display declared root output values from the current state; the second candidate terraform show -json addresses export state or saved plan information in machine-readable form. This mapping fails because the first mechanism primarily supports the task to display declared root output values from the current state and the second mechanism primarily supports the task to export state or saved plan information in machine-readable form; the actual requirements are export state or saved plan information in machine-readable form first and display declared root output values from the current state second.

C:

For the requested tasks to export state or saved plan information in machine-readable form and display declared root output values from the current state, the first candidate terraform state list addresses enumerate Terraform resource addresses currently tracked in a state snapshot; the second candidate terraform output addresses display declared root output values from the current state. This mapping fails because the first mechanism primarily supports the task to enumerate Terraform resource addresses currently tracked in a state snapshot; the actual requirements are export state or saved plan information in machine-readable form first and display declared root output values from the current state second.

E:

For the requested tasks to export state or saved plan information in machine-readable form and display declared root output values from the current state, the first candidate terraform show -json addresses export state or saved plan information in machine-readable form; the second candidate Address filter for state list addresses locate a relevant module or resource without reading every tracked address. This mapping fails because the second mechanism primarily supports the task to locate a relevant module or resource without reading every tracked address; the actual requirements are export state or saved plan information in machine-readable form first and display declared root output values from the current state second.

Question 485

During a Terraform 1.12 implementation, the immediate requirement is to represent unique elements where ordering does not matter. Which mechanism most directly meets this particular need?

  1. Type conversion function
  2. Optional object attribute
  3. Tuple type
  4. Set type

Explanation

Correct Answer

D:

The task is to represent unique elements where ordering does not matter; Set type directly supports that requirement: A set(T) deduplicates members and does not guarantee a stable positional order. Its relevant boundary is: Do not rely on numeric indexing into a set like a list.

Incorrect Answers

A:

Type conversion function is designed to convert a collection into a set before using for_each, whereas this task is to represent unique elements where ordering does not matter: toset(...) converts suitable values into a set, removing duplicates from a list input. Against Set type, its limitation is: The resulting collection should not be treated as positionally indexed.

B:

Optional object attribute is designed to allow an object input to omit a field with an optional type specification, whereas this task is to represent unique elements where ordering does not matter: optional(TYPE, DEFAULT) supports an omitted object attribute and can supply a default value. Against Set type, its limitation is: An optional attribute is not the same as an entirely optional module input variable.

C:

Tuple type is designed to describe a fixed sequence with independently typed positions, whereas this task is to represent unique elements where ordering does not matter: tuple([...]) declares the expected type at each list position. Against Set type, its limitation is: Its schema is positional, unlike named fields of an object.

Question 486

A change proposal relies on Validation of module inputs for the task to catch an unsupported or missing required module argument early. Which limitation specifically applies to it?

  1. Validation does not download missing plugins for itself.
  2. Input values can still fail runtime preconditions or provider API constraints later.
  3. It does not verify remote credentials or guarantee an apply succeeds.
  4. A configuration may validate even when its style differs from fmt output.

Explanation

Correct Answer

B:

For Validation of module inputs in the task to catch an unsupported or missing required module argument early, the important caution is: Input values can still fail runtime preconditions or provider API constraints later. The reason this matters is its actual behavior: terraform validate can report module call errors that violate input or schema requirements.

Incorrect Answers

A:

The proposed warning belongs to Validate after initializing, which serves the different goal to avoid plugin-schema errors when checking a newly cloned configuration, rather than to Validation of module inputs: An initialized directory provides modules and provider schemas needed for full configuration validation. The question concerns Validation of module inputs acting to catch an unsupported or missing required module argument early, not a limit of Validate after initializing.

C:

The proposed warning belongs to terraform validate command, which serves the different goal to check configuration syntax and internal consistency without proposing resource changes, rather than to Validation of module inputs: terraform validate checks the configuration's structural validity in an initialized directory. The question concerns Validation of module inputs acting to catch an unsupported or missing required module argument early, not a limit of terraform validate command.

D:

The proposed warning belongs to Formatting versus validation, which serves the different goal to distinguish syntactically valid code from canonical HCL formatting, rather than to Validation of module inputs: terraform fmt changes layout and spacing; terraform validate checks configuration correctness. The question concerns Validation of module inputs acting to catch an unsupported or missing required module argument early, not a limit of Formatting versus validation.

Question 487

In a reusable deployment, the primary objective is to define the supported arguments and attributes for one resource type. Which mechanism most directly meets this particular need?

  1. Plugin dependency installation
  2. Provider resource schema
  3. Provider data sources
  4. Provider selection for resource prefix

Explanation

Correct Answer

B:

The task is to define the supported arguments and attributes for one resource type; Provider resource schema directly supports that requirement: The provider schema specifies which settings users can configure and which values are computed. Its relevant boundary is: A generic Terraform language feature cannot invent unsupported provider arguments.

Incorrect Answers

A:

Plugin dependency installation is designed to resolve all referenced provider plugins before planning, whereas this task is to define the supported arguments and attributes for one resource type: An initialized working directory has the plugins required for its configured resources and data sources. Against Provider resource schema, its limitation is: A provider is not a Terraform module downloaded from a module source.

C:

Provider data sources is designed to read remote information without declaring ownership of its lifecycle, whereas this task is to define the supported arguments and attributes for one resource type: A provider data source queries external information that configuration can reference. Against Provider resource schema, its limitation is: It generally does not create or destroy the looked-up object.

D:

Provider selection for resource prefix is designed to associate a resource with the default provider for its type prefix, whereas this task is to define the supported arguments and attributes for one resource type: Without a provider meta-argument Terraform normally selects the matching local provider configuration. Against Provider resource schema, its limitation is: An alias must be chosen explicitly if the resource needs a nondefault configuration.

Question 488

The rollout owner asks whether Backend partial configuration is sufficient to supply backend settings during init rather than hardcoding all values. Which limitation specifically concerns that mechanism?

  1. Access to state metadata may expose more than the specific outputs, so permissions matter.
  2. Child module blocks do not create independent backend state files.
  3. Credentials may still leak if stored in a plan or command history; prefer secure credential flows.
  4. The migration should be confirmed and tested to avoid splitting state histories.

Explanation

Correct Answer

C:

For Backend partial configuration in the task to supply backend settings during init rather than hardcoding all values, the important caution is: Credentials may still leak if stored in a plan or command history; prefer secure credential flows. The reason this matters is its actual behavior: terraform init -backend-config can fill supported backend settings supplied outside checked-in files.

Incorrect Answers

A:

The proposed warning belongs to Data source for remote state outputs, which serves the different goal to consume published output values from another Terraform state where supported, rather than to Backend partial configuration: terraform_remote_state exposes root output values from a compatible existing state snapshot. The question concerns Backend partial configuration acting to supply backend settings during init rather than hardcoding all values, not a limit of Data source for remote state outputs.

B:

The proposed warning belongs to Backend configuration is root-only, which serves the different goal to set backend storage for a root execution rather than independently in each child module, rather than to Backend partial configuration: The active root module configures the backend used by that Terraform working directory. The question concerns Backend partial configuration acting to supply backend settings during init rather than hardcoding all values, not a limit of Backend configuration is root-only.

D:

The proposed warning belongs to Backend migration workflow, which serves the different goal to move an existing state history when switching remote storage, rather than to Backend partial configuration: terraform init -migrate-state supports moving state during an intentional backend change. The question concerns Backend partial configuration acting to supply backend settings during init rather than hardcoding all values, not a limit of Backend migration workflow.

Question 489

A change proposal relies on Module count meta-argument for the task to optionally instantiate a module based on a count expression. Which limitation specifically applies to it?

  1. Move mappings need compatible resource types and valid source/destination addresses.
  2. Each child must declare compatible provider requirements in its own module code.
  3. Count-based addressing is positional and differs from for_each keys.
  4. Changing a module's public interface still requires managing compatibility for callers.

Explanation

Correct Answer

C:

For Module count meta-argument in the task to optionally instantiate a module based on a count expression, the important caution is: Count-based addressing is positional and differs from for_each keys. The reason this matters is its actual behavior: count on a module block creates zero or more indexed module instances.

Incorrect Answers

A:

The proposed warning belongs to Module refactor with moved block, which serves the different goal to preserve resource identity when a configuration resource is moved into a module, rather than to Module count meta-argument: A moved block can map an old resource address to a new module resource address for state-aware refactoring. The question concerns Module count meta-argument acting to optionally instantiate a module based on a count expression, not a limit of Module refactor with moved block.

B:

The proposed warning belongs to Module provider passing, which serves the different goal to attach an explicitly selected provider configuration to child module resources, rather than to Module count meta-argument: The providers map lets a module receive the provider instance the caller intends. The question concerns Module count meta-argument acting to optionally instantiate a module based on a count expression, not a limit of Module provider passing.

D:

The proposed warning belongs to Module encapsulation, which serves the different goal to keep implementation resources private while exposing a stable input and output interface, rather than to Module count meta-argument: Modules promote reuse by letting callers depend on documented variables and outputs rather than every internal block. The question concerns Module count meta-argument acting to optionally instantiate a module based on a count expression, not a limit of Module encapsulation.

Question 490

Before adopting Workspace variable isolation to give development and production separate credentials and deployment values, which statement sets an accurate boundary?

  1. Project permission management needs Essentials, Standard, or Premium; provider cloud permissions remain independent of HCP roles.
  2. Project grouping is broadly available, but assigning project-level permissions requires an Essentials, Standard, or Premium plan; each workspace has its own state.
  3. Moving the workspace between projects does not merge its state with neighbors.
  4. Shared variable sets need appropriate scoping to avoid accidental cross-environment access.

Explanation

Correct Answer

D:

For Workspace variable isolation in the task to give development and production separate credentials and deployment values, the important caution is: Shared variable sets need appropriate scoping to avoid accidental cross-environment access. The reason this matters is its actual behavior: Distinct workspaces separate their state and input variables even when they use similar configuration.

Incorrect Answers

A:

The proposed warning belongs to Project-level team access, which serves the different goal to delegate a set of workspaces without granting broad organization-wide rights, rather than to Workspace variable isolation: Project-scoped team permissions help control who can manage associated workspaces. The question concerns Workspace variable isolation acting to give development and production separate credentials and deployment values, not a limit of Project-level team access.

B:

The proposed warning belongs to HCP Terraform project grouping, which serves the different goal to organize related workspaces and manage project-level access controls, rather than to Workspace variable isolation: Projects group HCP Terraform workspaces so teams can delegate organization and access by project. The question concerns Workspace variable isolation acting to give development and production separate credentials and deployment values, not a limit of HCP Terraform project grouping.

C:

The proposed warning belongs to Workspace placement within a project, which serves the different goal to associate one infrastructure workspace with the correct organizational project, rather than to Workspace variable isolation: A workspace can be assigned to a project representing its team or platform boundary. The question concerns Workspace variable isolation acting to give development and production separate credentials and deployment values, not a limit of Workspace placement within a project.

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