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

Question 800

A configuration review identifies the need to use output from one service to configure another supported service. Which mechanism most directly meets this particular need?

  1. Vendor portability through modules
  2. Multi-cloud provider configuration
  3. Provider-specific implementation
  4. Common Terraform lifecycle across providers
  5. Cross-platform dependency references

Explanation

Correct Answer

E:

The task is to use output from one service to configure another supported service; Cross-platform dependency references directly supports that requirement: References can establish ordering when a resource on one platform consumes attributes from another resource. Its relevant boundary is: The dependency does not remove authentication or network prerequisites on either platform.

Incorrect Answers

A:

Vendor portability through modules is designed to abstract a deployment pattern while keeping provider details explicit, whereas this task is to use output from one service to configure another supported service: A module can offer common input and output conventions even if its implementation uses provider-specific resources. Against Cross-platform dependency references, its limitation is: Replacing a cloud provider normally requires rewriting provider-dependent resources.

B:

Multi-cloud provider configuration is designed to manage different clouds from one Terraform root module, whereas this task is to use output from one service to configure another supported service: Separate provider plugins can reconcile resources on multiple platforms within the same configuration. Against Cross-platform dependency references, its limitation is: Each provider still needs suitable credentials and service permissions.

C:

Provider-specific implementation is designed to use a common language without pretending providers expose identical capabilities, whereas this task is to use output from one service to configure another supported service: HCL and workflow are common while each provider defines its own resource schema and service-specific behavior. Against Cross-platform dependency references, its limitation is: A resource type from one provider cannot be substituted blindly for another.

D:

Common Terraform lifecycle across providers is designed to plan and apply resources from several providers in one run, whereas this task is to use output from one service to configure another supported service: Terraform Core constructs a dependency graph and asks installed providers to implement their own actions. Against Cross-platform dependency references, its limitation is: A unified plan cannot guarantee a distributed transaction across separate providers.

Question 801

During a Terraform 1.12 implementation, the immediate requirement is to capture highly detailed events for a stubborn Terraform problem. Which mechanism most directly meets this particular need?

  1. Log analysis and source protection
  2. Disable debug logging after diagnosis
  3. TF_LOG environment variable
  4. TRACE diagnostic level
  5. TF_LOG_PROVIDER environment variable

Explanation

Correct Answer

D:

The task is to capture highly detailed events for a stubborn Terraform problem; TRACE diagnostic level directly supports that requirement: TRACE is a very verbose Terraform logging level useful for deep troubleshooting. Its relevant boundary is: It is too noisy and potentially sensitive for routine production pipelines.

Incorrect Answers

A:

Log analysis and source protection is designed to review debugging evidence without publishing API secrets, whereas this task is to capture highly detailed events for a stubborn Terraform problem: Diagnostic logs should be stored and shared according to secret-handling policy. Against TRACE diagnostic level, its limitation is: A log that shows an error does not automatically identify the root cause without context.

B:

Disable debug logging after diagnosis is designed to avoid collecting unnecessary sensitive operational output, whereas this task is to capture highly detailed events for a stubborn Terraform problem: Unset debug environment variables or restore normal log settings when the investigation ends. Against TRACE diagnostic level, its limitation is: Leaving verbose logs enabled can produce large sensitive artifacts.

C:

TF_LOG environment variable is designed to enable Terraform debugging output while investigating a CLI failure, whereas this task is to capture highly detailed events for a stubborn Terraform problem: TF_LOG sets a supported logging level such as DEBUG or TRACE for a Terraform process. Against TRACE diagnostic level, its limitation is: Verbose logs can contain sensitive data and should be protected.

E:

TF_LOG_PROVIDER environment variable is designed to focus verbose diagnostics on provider-side activity, whereas this task is to capture highly detailed events for a stubborn Terraform problem: TF_LOG_PROVIDER controls the provider logging level to aid plugin or API troubleshooting. Against TRACE diagnostic level, its limitation is: Provider logs may reveal credentials or request data and require caution.

Question 802

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

  1. convert a saved plan into JSON for automated analysis
  2. recognize that a proposed change will replace an existing resource
  3. avoid remote refresh reads when an intentional troubleshooting constraint requires it
  4. inspect externally changed infrastructure without planning configuration reconciliation

Explanation

Correct Answer

B:

The practical result of Replacement plan indicator, used to recognize that a proposed change will replace an existing resource, is: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering. A qualification for this effect is: An in-place update is represented differently and preserves the existing instance.

Incorrect Answers

A:

That outcome applies to Machine-readable plan inspection, intended to convert a saved plan into JSON for automated analysis, rather than the question's feature Replacement plan indicator: terraform show -json change.tfplan exposes plan details for tooling. Unlike Machine-readable plan inspection, Replacement plan indicator is intended to recognize that a proposed change will replace an existing resource, not to convert a saved plan into JSON for automated analysis.

C:

That outcome applies to Plan without state refresh, intended to avoid remote refresh reads when an intentional troubleshooting constraint requires it, rather than the question's feature Replacement plan indicator: terraform plan -refresh=false uses existing state without refreshing live objects before planning. Unlike Plan without state refresh, Replacement plan indicator is intended to recognize that a proposed change will replace an existing resource, not to avoid remote refresh reads when an intentional troubleshooting constraint requires it.

D:

That outcome applies to Refresh-only planning, intended to inspect externally changed infrastructure without planning configuration reconciliation, rather than the question's feature Replacement plan indicator: terraform plan -refresh-only proposes updates to state and outputs based on remote observations. Unlike Refresh-only planning, Replacement plan indicator is intended to recognize that a proposed change will replace an existing resource, not to inspect externally changed infrastructure without planning configuration reconciliation.

Question 803

An operator chooses the mechanism "Drift reconciliation to configuration" for a Terraform project. Which outcome should this choice support?

  1. accept an external change into Terraform state without modifying remote infrastructure
  2. rename a managed resource address without destroying its remote object
  3. restore externally modified resource settings to desired code values
  4. recognize that a resource was changed outside Terraform

Explanation

Correct Answer

C:

The practical result of Drift reconciliation to configuration, used to restore externally modified resource settings to desired code values, is: A regular plan and apply can propose changing a drifted object back to configured settings. A qualification for this effect is: A refresh-only apply instead accepts observed remote values into state.

Incorrect Answers

A:

That outcome applies to Refresh-only reconciliation, intended to accept an external change into Terraform state without modifying remote infrastructure, rather than the question's feature Drift reconciliation to configuration: A refresh-only plan or apply updates state and outputs to observed values. Unlike Refresh-only reconciliation, Drift reconciliation to configuration is intended to restore externally modified resource settings to desired code values, not to accept an external change into Terraform state without modifying remote infrastructure.

B:

That outcome applies to moved block for refactoring, intended to rename a managed resource address without destroying its remote object, rather than the question's feature Drift reconciliation to configuration: A moved block describes an address migration as part of configuration history. Unlike moved block for refactoring, Drift reconciliation to configuration is intended to restore externally modified resource settings to desired code values, not to rename a managed resource address without destroying its remote object.

D:

That outcome applies to Remote drift detection during plan, intended to recognize that a resource was changed outside Terraform, rather than the question's feature Drift reconciliation to configuration: Normal plan refresh reads can reveal drift between state and the remote object. Unlike Remote drift detection during plan, Drift reconciliation to configuration is intended to restore externally modified resource settings to desired code values, not to recognize that a resource was changed outside Terraform.

Question 804

A design uses Explicit depends_on relationship to order otherwise unreferenced actions that have a hidden operational dependency. Which qualification applies to the named mechanism?

  1. It is not a general string-based condition on arbitrary local values.
  2. Changing file order does not resolve a cyclic dependency graph.
  3. Excessive explicit dependencies can make planning conservative and values unknown.
  4. Ignored attributes may still be used during initial resource creation.

Explanation

Correct Answer

C:

For Explicit depends_on relationship in the task to order otherwise unreferenced actions that have a hidden operational dependency, the important caution is: Excessive explicit dependencies can make planning conservative and values unknown. The reason this matters is its actual behavior: depends_on declares an ordering relationship when there is no suitable value reference.

Incorrect Answers

A:

The proposed warning belongs to replace_triggered_by lifecycle, which serves the different goal to replace a resource when a specified managed resource change occurs, rather than to Explicit depends_on relationship: replace_triggered_by adds replacement behavior tied to changes in other managed objects or attributes. The question concerns Explicit depends_on relationship acting to order otherwise unreferenced actions that have a hidden operational dependency, not a limit of replace_triggered_by lifecycle.

B:

The proposed warning belongs to Terraform resource graph cycle, which serves the different goal to detect an impossible dependency ordering caused by circular references, rather than to Explicit depends_on relationship: Terraform reports cycles when resources depend on one another in a way it cannot order. The question concerns Explicit depends_on relationship acting to order otherwise unreferenced actions that have a hidden operational dependency, not a limit of Terraform resource graph cycle.

D:

The proposed warning belongs to ignore_changes lifecycle, which serves the different goal to suppress planned updates for selected externally managed attributes, rather than to Explicit depends_on relationship: ignore_changes tells Terraform to disregard specified differences when planning updates to an existing resource. The question concerns Explicit depends_on relationship acting to order otherwise unreferenced actions that have a hidden operational dependency, not a limit of ignore_changes lifecycle.

Question 805

A configuration walkthrough identifies "Module versus provider version lock". Which task is it principally intended to support?

  1. make a published module dependency deterministic across clean installs
  2. fetch a newly allowed version after editing the module version requirement
  3. select module releases meeting a declared compatibility range
  4. track module release selection separately from provider lock file behavior

Explanation

Correct Answer

D:

The practical result of Module versus provider version lock, used to track module release selection separately from provider lock file behavior, is: Module versions are selected by module source and version settings, whereas the lock file records providers. A qualification for this effect is: Assuming .terraform.lock.hcl freezes registry modules can surprise a new installation.

Incorrect Answers

A:

That outcome applies to Exact registry module version, intended to make a published module dependency deterministic across clean installs, rather than the question's feature Module versus provider version lock: An exact version requirement identifies one registry module release. Unlike Exact registry module version, Module versus provider version lock is intended to track module release selection separately from provider lock file behavior, not to make a published module dependency deterministic across clean installs.

B:

That outcome applies to Module upgrade through init, intended to fetch a newly allowed version after editing the module version requirement, rather than the question's feature Module versus provider version lock: Rerunning terraform init downloads compatible module source versions when module requirements change. Unlike Module upgrade through init, Module versus provider version lock is intended to track module release selection separately from provider lock file behavior, not to fetch a newly allowed version after editing the module version requirement.

C:

That outcome applies to Registry module version constraint, intended to select module releases meeting a declared compatibility range, rather than the question's feature Module versus provider version lock: A registry module call accepts a version argument that chooses supported release versions. Unlike Registry module version constraint, Module versus provider version lock is intended to track module release selection separately from provider lock file behavior, not to select module releases meeting a declared compatibility range.

Question 806

A team reviews the use of HCP Terraform workspace variable configuration in Terraform 1.12. Which purpose matches its actual behavior?

  1. move a locally managed state history into an HCP Terraform workspace
  2. initiate workspace operations through familiar Terraform commands
  3. control the Terraform version used for remote runs
  4. provide Terraform and environment variables to a hosted run

Explanation

Correct Answer

D:

The practical result of HCP Terraform workspace variable configuration, used to provide Terraform and environment variables to a hosted run, is: Workspace variables and variable sets can supply inputs or environment settings to HCP Terraform operations. A qualification for this effect is: Sensitive values should be marked appropriately and access limited.

Incorrect Answers

A:

That outcome applies to Local to HCP state migration, intended to move a locally managed state history into an HCP Terraform workspace, rather than the question's feature HCP Terraform workspace variable configuration: Changing state integration and reinitializing can migrate state into HCP Terraform when configured correctly. Unlike Local to HCP state migration, HCP Terraform workspace variable configuration is intended to provide Terraform and environment variables to a hosted run, not to move a locally managed state history into an HCP Terraform workspace.

B:

That outcome applies to CLI-driven HCP runs, intended to initiate workspace operations through familiar Terraform commands, rather than the question's feature HCP Terraform workspace variable configuration: HCP Terraform supports CLI-driven workflows connected to remote workspace state and operations. Unlike CLI-driven HCP runs, HCP Terraform workspace variable configuration is intended to provide Terraform and environment variables to a hosted run, not to initiate workspace operations through familiar Terraform commands.

C:

That outcome applies to HCP Terraform workspace version settings, intended to control the Terraform version used for remote runs, rather than the question's feature HCP Terraform workspace variable configuration: Workspace settings can select the Terraform Core version used in HCP remote execution. Unlike HCP Terraform workspace version settings, HCP Terraform workspace variable configuration is intended to provide Terraform and environment variables to a hosted run, not to control the Terraform version used for remote runs.

Question 807

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

  1. direct an individual resource to the intended aliased provider
  2. configure a second instance of the same provider for another account or region
  3. declare several provider types in the same root module
  4. let a child module use default provider settings from its parent
  5. pass an aliased provider to resources inside a child module

Explanation

Correct Answer

D:

The practical result of Default provider configuration inheritance, used to let a child module use default provider settings from its parent, is: Child modules commonly inherit default provider configurations from the calling module. A qualification for this effect is: Aliases and complex configurations often require explicit mapping.

Incorrect Answers

A:

That outcome applies to Resource provider meta-argument, intended to direct an individual resource to the intended aliased provider, rather than the question's feature Default provider configuration inheritance: The provider meta-argument can select a configured instance such as aws.west for that resource. Unlike Resource provider meta-argument, Default provider configuration inheritance is intended to let a child module use default provider settings from its parent, not to direct an individual resource to the intended aliased provider.

B:

That outcome applies to Aliased provider instance, intended to configure a second instance of the same provider for another account or region, rather than the question's feature Default provider configuration inheritance: The alias argument gives a provider configuration an additional address that resources can select. Unlike Aliased provider instance, Default provider configuration inheritance is intended to let a child module use default provider settings from its parent, not to configure a second instance of the same provider for another account or region.

C:

That outcome applies to Different provider local names, intended to declare several provider types in the same root module, rather than the question's feature Default provider configuration inheritance: The required_providers map can list multiple source addresses with distinct local names. Unlike Different provider local names, Default provider configuration inheritance is intended to let a child module use default provider settings from its parent, not to declare several provider types in the same root module.

E:

That outcome applies to Explicit child module provider mapping, intended to pass an aliased provider to resources inside a child module, rather than the question's feature Default provider configuration inheritance: The providers map in a module block maps the child's provider name to a parent provider configuration. Unlike Explicit child module provider mapping, Default provider configuration inheritance is intended to let a child module use default provider settings from its parent, not to pass an aliased provider to resources inside a child module.

Question 808

The implementation must both order otherwise unreferenced actions that have a hidden operational dependency and protect a declared resource from plans that destroy its managed object. Which TWO mechanisms directly address these two separate requirements? Choose TWO.

  1. Explicit depends_on relationship
  2. prevent_destroy lifecycle
  3. create_before_destroy lifecycle
  4. ignore_changes lifecycle
  5. Implicit dependency from expression

Explanation

Correct Answers

A:

Among the paired tasks to order otherwise unreferenced actions that have a hidden operational dependency and protect a declared resource from plans that destroy its managed object, Explicit depends_on relationship serves the requirement to order otherwise unreferenced actions that have a hidden operational dependency: depends_on declares an ordering relationship when there is no suitable value reference. The other task must be covered by a separate mechanism.

B:

Among the paired tasks to order otherwise unreferenced actions that have a hidden operational dependency and protect a declared resource from plans that destroy its managed object, prevent_destroy lifecycle serves the requirement to protect a declared resource from plans that destroy its managed object: prevent_destroy causes an error if a plan includes destruction while the rule is present in configuration. The other task must be covered by a separate mechanism.

Incorrect Answers

C:

The requirements are order otherwise unreferenced actions that have a hidden operational dependency and protect a declared resource from plans that destroy its managed object, while create_before_destroy lifecycle supports the different task to favor replacement resource creation before deletion of its predecessor: The lifecycle rule changes replacement ordering when the provider and external constraints permit it. That capability is outside the two selected responsibilities.

D:

The requirements are order otherwise unreferenced actions that have a hidden operational dependency and protect a declared resource from plans that destroy its managed object, while ignore_changes lifecycle supports the different task to suppress planned updates for selected externally managed attributes: ignore_changes tells Terraform to disregard specified differences when planning updates to an existing resource. That capability is outside the two selected responsibilities.

E:

The requirements are order otherwise unreferenced actions that have a hidden operational dependency and protect a declared resource from plans that destroy its managed object, while Implicit dependency from expression supports the different task to order resources when one consumes an attribute produced by another: Terraform derives an edge from an expression reference and schedules the producer first. That capability is outside the two selected responsibilities.

Question 809

The team is documenting risks of Replacement plan indicator while planning to recognize that a proposed change will replace an existing resource. Which caveat specifically applies to that mechanism?

  1. It does not use configuration to correct drift in the remote service.
  2. The JSON can expose secrets and requires secure handling.
  3. A plan based on stale state can be inaccurate about real infrastructure.
  4. An in-place update is represented differently and preserves the existing instance.
  5. Saved plans can include sensitive data and should not be committed publicly.

Explanation

Correct Answer

D:

For Replacement plan indicator in the task to recognize that a proposed change will replace an existing resource, the important caution is: An in-place update is represented differently and preserves the existing instance. The reason this matters is its actual behavior: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering.

Incorrect Answers

A:

The proposed warning belongs to Refresh-only planning, which serves the different goal to inspect externally changed infrastructure without planning configuration reconciliation, rather than to Replacement plan indicator: terraform plan -refresh-only proposes updates to state and outputs based on remote observations. The question concerns Replacement plan indicator acting to recognize that a proposed change will replace an existing resource, not a limit of Refresh-only planning.

B:

The proposed warning belongs to Machine-readable plan inspection, which serves the different goal to convert a saved plan into JSON for automated analysis, rather than to Replacement plan indicator: terraform show -json change.tfplan exposes plan details for tooling. The question concerns Replacement plan indicator acting to recognize that a proposed change will replace an existing resource, not a limit of Machine-readable plan inspection.

C:

The proposed warning belongs to Plan without state refresh, which serves the different goal to avoid remote refresh reads when an intentional troubleshooting constraint requires it, rather than to Replacement plan indicator: terraform plan -refresh=false uses existing state without refreshing live objects before planning. The question concerns Replacement plan indicator acting to recognize that a proposed change will replace an existing resource, not a limit of Plan without state refresh.

E:

The listed caution belongs specifically to Plan saved to file, used to capture one execution plan for later approval and application: terraform plan -out=change.tfplan saves an executable binary plan artifact; the feature under review is instead Replacement plan indicator, so this answer attaches another feature's qualification to the wrong mechanism.

Question 810

A design uses Drift reconciliation to configuration to restore externally modified resource settings to desired code values. Which qualification applies to the named mechanism?

  1. A refresh-only apply instead accepts observed remote values into state.
  2. Configuration reconciliation requires a subsequent reviewed apply.
  3. It does not transfer a resource between unrelated provider types.
  4. It does not make the live object conform to an old configuration value.

Explanation

Correct Answer

A:

For Drift reconciliation to configuration in the task to restore externally modified resource settings to desired code values, the important caution is: A refresh-only apply instead accepts observed remote values into state. The reason this matters is its actual behavior: A regular plan and apply can propose changing a drifted object back to configured settings.

Incorrect Answers

B:

The proposed warning belongs to Remote drift detection during plan, which serves the different goal to recognize that a resource was changed outside Terraform, rather than to Drift reconciliation to configuration: Normal plan refresh reads can reveal drift between state and the remote object. The question concerns Drift reconciliation to configuration acting to restore externally modified resource settings to desired code values, not a limit of Remote drift detection during plan.

C:

The proposed warning belongs to moved block for refactoring, which serves the different goal to rename a managed resource address without destroying its remote object, rather than to Drift reconciliation to configuration: A moved block describes an address migration as part of configuration history. The question concerns Drift reconciliation to configuration acting to restore externally modified resource settings to desired code values, not a limit of moved block for refactoring.

D:

The proposed warning belongs to Refresh-only reconciliation, which serves the different goal to accept an external change into Terraform state without modifying remote infrastructure, rather than to Drift reconciliation to configuration: A refresh-only plan or apply updates state and outputs to observed values. The question concerns Drift reconciliation to configuration acting to restore externally modified resource settings to desired code values, not a limit of Refresh-only reconciliation.

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