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

Question 820

A Terraform rollout has two separate requirements: first, provide Terraform and environment variables to a hosted run; second, associate a Terraform root configuration with an HCP Terraform organization and workspace. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use HCP Terraform workspace selection; then use Local to HCP state migration.
  2. First use cloud block HCP integration; then use HCP Terraform workspace variable configuration.
  3. First use Local to HCP state migration; then use cloud block HCP integration.
  4. First use HCP Terraform workspace variable configuration; then use cloud block HCP integration.
  5. First use HCP Terraform workspace variable configuration; then use HCP Terraform workspace selection.

Explanation

Correct Answer

D:

The first requirement, to provide Terraform and environment variables to a hosted run, is handled by HCP Terraform workspace variable configuration: Workspace variables and variable sets can supply inputs or environment settings to HCP Terraform operations. The second requirement, to associate a Terraform root configuration with an HCP Terraform organization and workspace, is handled by cloud block HCP integration: A cloud block in terraform settings configures the HCP Terraform integration for that root module. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to provide Terraform and environment variables to a hosted run and associate a Terraform root configuration with an HCP Terraform organization and workspace, the first candidate HCP Terraform workspace selection addresses route CLI-driven operations to the intended HCP workspace; the second candidate Local to HCP state migration addresses move a locally managed state history into an HCP Terraform workspace. This mapping fails because the first mechanism primarily supports the task to route CLI-driven operations to the intended HCP workspace and the second mechanism primarily supports the task to move a locally managed state history into an HCP Terraform workspace; the actual requirements are provide Terraform and environment variables to a hosted run first and associate a Terraform root configuration with an HCP Terraform organization and workspace second.

B:

For the requested tasks to provide Terraform and environment variables to a hosted run and associate a Terraform root configuration with an HCP Terraform organization and workspace, the first candidate cloud block HCP integration addresses associate a Terraform root configuration with an HCP Terraform organization and workspace; the second candidate HCP Terraform workspace variable configuration addresses provide Terraform and environment variables to a hosted run. This mapping fails because the first mechanism primarily supports the task to associate a Terraform root configuration with an HCP Terraform organization and workspace and the second mechanism primarily supports the task to provide Terraform and environment variables to a hosted run; the actual requirements are provide Terraform and environment variables to a hosted run first and associate a Terraform root configuration with an HCP Terraform organization and workspace second.

C:

For the requested tasks to provide Terraform and environment variables to a hosted run and associate a Terraform root configuration with an HCP Terraform organization and workspace, the first candidate Local to HCP state migration addresses move a locally managed state history into an HCP Terraform workspace; the second candidate cloud block HCP integration addresses associate a Terraform root configuration with an HCP Terraform organization and workspace. This mapping fails because the first mechanism primarily supports the task to move a locally managed state history into an HCP Terraform workspace; the actual requirements are provide Terraform and environment variables to a hosted run first and associate a Terraform root configuration with an HCP Terraform organization and workspace second.

E:

For the requested tasks to provide Terraform and environment variables to a hosted run and associate a Terraform root configuration with an HCP Terraform organization and workspace, the first candidate HCP Terraform workspace variable configuration addresses provide Terraform and environment variables to a hosted run; the second candidate HCP Terraform workspace selection addresses route CLI-driven operations to the intended HCP workspace. This mapping fails because the second mechanism primarily supports the task to route CLI-driven operations to the intended HCP workspace; the actual requirements are provide Terraform and environment variables to a hosted run first and associate a Terraform root configuration with an HCP Terraform organization and workspace second.

Question 821

During an implementation review, a Terraform team encounters "create_before_destroy lifecycle". Which purpose is associated with that mechanism?

  1. order resources when one consumes an attribute produced by another
  2. order otherwise unreferenced actions that have a hidden operational dependency
  3. favor replacement resource creation before deletion of its predecessor
  4. suppress planned updates for selected externally managed attributes

Explanation

Correct Answer

C:

The practical result of create_before_destroy lifecycle, used to favor replacement resource creation before deletion of its predecessor, is: The lifecycle rule changes replacement ordering when the provider and external constraints permit it. A qualification for this effect is: A uniqueness constraint or quota can still prevent parallel old and new objects.

Incorrect Answers

A:

That outcome applies to Implicit dependency from expression, intended to order resources when one consumes an attribute produced by another, rather than the question's feature create_before_destroy lifecycle: Terraform derives an edge from an expression reference and schedules the producer first. Unlike Implicit dependency from expression, create_before_destroy lifecycle is intended to favor replacement resource creation before deletion of its predecessor, not to order resources when one consumes an attribute produced by another.

B:

That outcome applies to Explicit depends_on relationship, intended to order otherwise unreferenced actions that have a hidden operational dependency, rather than the question's feature create_before_destroy lifecycle: depends_on declares an ordering relationship when there is no suitable value reference. Unlike Explicit depends_on relationship, create_before_destroy lifecycle is intended to favor replacement resource creation before deletion of its predecessor, not to order otherwise unreferenced actions that have a hidden operational dependency.

D:

The outcome in this option belongs to ignore_changes lifecycle: ignore_changes tells Terraform to disregard specified differences when planning updates to an existing resource; by contrast, the feature actually named in the stem, create_before_destroy lifecycle, has a distinct purpose: to favor replacement resource creation before deletion of its predecessor.

Question 822

The rollout owner asks whether Cross-platform dependency references is sufficient to use output from one service to configure another supported service. Which limitation specifically concerns that mechanism?

  1. Replacing a cloud provider normally requires rewriting provider-dependent resources.
  2. The dependency does not remove authentication or network prerequisites on either platform.
  3. A unified plan cannot guarantee a distributed transaction across separate providers.
  4. A resource type from one provider cannot be substituted blindly for another.

Explanation

Correct Answer

B:

For Cross-platform dependency references in the task to use output from one service to configure another supported service, the important caution is: The dependency does not remove authentication or network prerequisites on either platform. The reason this matters is its actual behavior: References can establish ordering when a resource on one platform consumes attributes from another resource.

Incorrect Answers

A:

The proposed warning belongs to Vendor portability through modules, which serves the different goal to abstract a deployment pattern while keeping provider details explicit, rather than to Cross-platform dependency references: A module can offer common input and output conventions even if its implementation uses provider-specific resources. The question concerns Cross-platform dependency references acting to use output from one service to configure another supported service, not a limit of Vendor portability through modules.

C:

The proposed warning belongs to Common Terraform lifecycle across providers, which serves the different goal to plan and apply resources from several providers in one run, rather than to Cross-platform dependency references: Terraform Core constructs a dependency graph and asks installed providers to implement their own actions. The question concerns Cross-platform dependency references acting to use output from one service to configure another supported service, not a limit of Common Terraform lifecycle across providers.

D:

The proposed warning belongs to Provider-specific implementation, which serves the different goal to use a common language without pretending providers expose identical capabilities, rather than to Cross-platform dependency references: HCL and workflow are common while each provider defines its own resource schema and service-specific behavior. The question concerns Cross-platform dependency references acting to use output from one service to configure another supported service, not a limit of Provider-specific implementation.

Question 823

The rollout owner asks whether TRACE diagnostic level is sufficient to capture highly detailed events for a stubborn Terraform problem. Which limitation specifically concerns that mechanism?

  1. A log that shows an error does not automatically identify the root cause without context.
  2. Leaving verbose logs enabled can produce large sensitive artifacts.
  3. Provider logs may reveal credentials or request data and require caution.
  4. It is too noisy and potentially sensitive for routine production pipelines.

Explanation

Correct Answer

D:

For TRACE diagnostic level in the task to capture highly detailed events for a stubborn Terraform problem, the important caution is: It is too noisy and potentially sensitive for routine production pipelines. The reason this matters is its actual behavior: TRACE is a very verbose Terraform logging level useful for deep troubleshooting.

Incorrect Answers

A:

The proposed warning belongs to Log analysis and source protection, which serves the different goal to review debugging evidence without publishing API secrets, rather than to TRACE diagnostic level: Diagnostic logs should be stored and shared according to secret-handling policy. The question concerns TRACE diagnostic level acting to capture highly detailed events for a stubborn Terraform problem, not a limit of Log analysis and source protection.

B:

The proposed warning belongs to Disable debug logging after diagnosis, which serves the different goal to avoid collecting unnecessary sensitive operational output, rather than to TRACE diagnostic level: Unset debug environment variables or restore normal log settings when the investigation ends. The question concerns TRACE diagnostic level acting to capture highly detailed events for a stubborn Terraform problem, not a limit of Disable debug logging after diagnosis.

C:

The proposed warning belongs to TF_LOG_PROVIDER environment variable, which serves the different goal to focus verbose diagnostics on provider-side activity, rather than to TRACE diagnostic level: TF_LOG_PROVIDER controls the provider logging level to aid plugin or API troubleshooting. The question concerns TRACE diagnostic level acting to capture highly detailed events for a stubborn Terraform problem, not a limit of TF_LOG_PROVIDER environment variable.

Question 824

For a new infrastructure repository, the team wants to execute proposed operations after reviewing their impact. Which mechanism most directly meets this particular need?

  1. Apply without interactive approval
  2. Dependency-ordered apply
  3. Apply a previously saved plan
  4. Apply the current configuration

Explanation

Correct Answer

D:

The task is to execute proposed operations after reviewing their impact; Apply the current configuration directly supports that requirement: terraform apply normally creates a plan and asks for approval before making changes. Its relevant boundary is: A plan might fail during execution if a provider API rejects an action.

Incorrect Answers

A:

Apply without interactive approval is designed to run a controlled automated deployment from current configuration, whereas this task is to execute proposed operations after reviewing their impact: terraform apply -auto-approve skips the interactive approval prompt for an unsaved plan. Against Apply the current configuration, its limitation is: It is appropriate only when automation has separate policy and authorization controls.

B:

Dependency-ordered apply is designed to create an upstream object before a dependent reference is resolved, whereas this task is to execute proposed operations after reviewing their impact: Terraform uses references and explicit dependencies to order apply graph operations. Against Apply the current configuration, its limitation is: The order is not determined by the placement of resource blocks in files.

C:

Apply a previously saved plan is designed to execute precisely a previously generated binary execution plan, whereas this task is to execute proposed operations after reviewing their impact: terraform apply change.tfplan applies that saved plan rather than recalculating a fresh interactive plan. Against Apply the current configuration, its limitation is: The saved artifact may become stale if state changes after its creation.

Question 825

A change proposal relies on create_before_destroy lifecycle for the task to favor replacement resource creation before deletion of its predecessor. Which limitation specifically applies to it?

  1. Removing the entire resource configuration also removes this protective rule.
  2. Excessive explicit dependencies can make planning conservative and values unknown.
  3. Ignored attributes may still be used during initial resource creation.
  4. A uniqueness constraint or quota can still prevent parallel old and new objects.

Explanation

Correct Answer

D:

For create_before_destroy lifecycle in the task to favor replacement resource creation before deletion of its predecessor, the important caution is: A uniqueness constraint or quota can still prevent parallel old and new objects. The reason this matters is its actual behavior: The lifecycle rule changes replacement ordering when the provider and external constraints permit it.

Incorrect Answers

A:

The proposed warning belongs to prevent_destroy lifecycle, which serves the different goal to protect a declared resource from plans that destroy its managed object, rather than to create_before_destroy lifecycle: prevent_destroy causes an error if a plan includes destruction while the rule is present in configuration. The question concerns create_before_destroy lifecycle acting to favor replacement resource creation before deletion of its predecessor, not a limit of prevent_destroy lifecycle.

B:

The proposed warning belongs to Explicit depends_on relationship, which serves the different goal to order otherwise unreferenced actions that have a hidden operational dependency, rather than to create_before_destroy lifecycle: depends_on declares an ordering relationship when there is no suitable value reference. The question concerns create_before_destroy lifecycle acting to favor replacement resource creation before deletion of its predecessor, not a limit of Explicit depends_on relationship.

C:

The listed caution belongs specifically to ignore_changes lifecycle, used to suppress planned updates for selected externally managed attributes: ignore_changes tells Terraform to disregard specified differences when planning updates to an existing resource; the feature under review is instead create_before_destroy lifecycle, so this answer attaches another feature's qualification to the wrong mechanism.

Question 826

The implementation must both let a child module use default provider settings from its parent and create similar resources in different regions without duplicating the root module. Which TWO mechanisms directly address these two separate requirements? Choose TWO.

  1. Default provider configuration inheritance
  2. Multiple regions in one configuration
  3. Different provider local names
  4. Resource provider meta-argument
  5. Explicit child module provider mapping

Explanation

Correct Answers

A:

Among the paired tasks to let a child module use default provider settings from its parent and create similar resources in different regions without duplicating the root module, Default provider configuration inheritance serves the requirement to let a child module use default provider settings from its parent: Child modules commonly inherit default provider configurations from the calling module. The other task must be covered by a separate mechanism.

B:

Among the paired tasks to let a child module use default provider settings from its parent and create similar resources in different regions without duplicating the root module, Multiple regions in one configuration serves the requirement to create similar resources in different regions without duplicating the root module: Two provider instances with different region settings can serve explicitly assigned resources or modules. The other task must be covered by a separate mechanism.

Incorrect Answers

C:

The requirements are let a child module use default provider settings from its parent and create similar resources in different regions without duplicating the root module, while Different provider local names supports the different task to declare several provider types in the same root module: The required_providers map can list multiple source addresses with distinct local names. That capability is outside the two selected responsibilities.

D:

The requirements are let a child module use default provider settings from its parent and create similar resources in different regions without duplicating the root module, while Resource provider meta-argument supports the different task to direct an individual resource to the intended aliased provider: The provider meta-argument can select a configured instance such as aws.west for that resource. That capability is outside the two selected responsibilities.

E:

The requested tasks are to let a child module use default provider settings from its parent; create similar resources in different regions without duplicating the root module, but Explicit child module provider mapping primarily addresses the different goal to pass an aliased provider to resources inside a child module: The providers map in a module block maps the child's provider name to a parent provider configuration; therefore it is not one of the mechanisms selected for the stated requirements.

Question 827

A Terraform rollout has two separate requirements: first, favor replacement resource creation before deletion of its predecessor; second, suppress planned updates for selected externally managed attributes. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Terraform resource graph cycle; then use ignore_changes lifecycle.
  2. First use replace_triggered_by lifecycle; then use Terraform resource graph cycle.
  3. First use ignore_changes lifecycle; then use create_before_destroy lifecycle.
  4. First use create_before_destroy lifecycle; then use replace_triggered_by lifecycle.
  5. First use create_before_destroy lifecycle; then use ignore_changes lifecycle.

Explanation

Correct Answer

E:

The first requirement, to favor replacement resource creation before deletion of its predecessor, is handled by create_before_destroy lifecycle: The lifecycle rule changes replacement ordering when the provider and external constraints permit it. The second requirement, to suppress planned updates for selected externally managed attributes, is handled by ignore_changes lifecycle: ignore_changes tells Terraform to disregard specified differences when planning updates to an existing resource. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to favor replacement resource creation before deletion of its predecessor and suppress planned updates for selected externally managed attributes, the first candidate Terraform resource graph cycle addresses detect an impossible dependency ordering caused by circular references; the second candidate ignore_changes lifecycle addresses suppress planned updates for selected externally managed attributes. This mapping fails because the first mechanism primarily supports the task to detect an impossible dependency ordering caused by circular references; the actual requirements are favor replacement resource creation before deletion of its predecessor first and suppress planned updates for selected externally managed attributes second.

B:

For the requested tasks to favor replacement resource creation before deletion of its predecessor and suppress planned updates for selected externally managed attributes, the first candidate replace_triggered_by lifecycle addresses replace a resource when a specified managed resource change occurs; the second candidate Terraform resource graph cycle addresses detect an impossible dependency ordering caused by circular references. This mapping fails because the first mechanism primarily supports the task to replace a resource when a specified managed resource change occurs and the second mechanism primarily supports the task to detect an impossible dependency ordering caused by circular references; the actual requirements are favor replacement resource creation before deletion of its predecessor first and suppress planned updates for selected externally managed attributes second.

C:

For the requested tasks to favor replacement resource creation before deletion of its predecessor and suppress planned updates for selected externally managed attributes, the first candidate ignore_changes lifecycle addresses suppress planned updates for selected externally managed attributes; the second candidate create_before_destroy lifecycle addresses favor replacement resource creation before deletion of its predecessor. This mapping fails because the first mechanism primarily supports the task to suppress planned updates for selected externally managed attributes and the second mechanism primarily supports the task to favor replacement resource creation before deletion of its predecessor; the actual requirements are favor replacement resource creation before deletion of its predecessor first and suppress planned updates for selected externally managed attributes second.

D:

For the requested tasks to favor replacement resource creation before deletion of its predecessor and suppress planned updates for selected externally managed attributes, the first candidate create_before_destroy lifecycle addresses favor replacement resource creation before deletion of its predecessor; the second candidate replace_triggered_by lifecycle addresses replace a resource when a specified managed resource change occurs. This mapping fails because the second mechanism primarily supports the task to replace a resource when a specified managed resource change occurs; the actual requirements are favor replacement resource creation before deletion of its predecessor first and suppress planned updates for selected externally managed attributes second.

Question 828

An operator chooses the mechanism "Apply the current configuration" for a Terraform project. Which outcome should this choice support?

  1. create an upstream object before a dependent reference is resolved
  2. execute proposed operations after reviewing their impact
  3. run a controlled automated deployment from current configuration
  4. execute precisely a previously generated binary execution plan

Explanation

Correct Answer

B:

The practical result of Apply the current configuration, used to execute proposed operations after reviewing their impact, is: terraform apply normally creates a plan and asks for approval before making changes. A qualification for this effect is: A plan might fail during execution if a provider API rejects an action.

Incorrect Answers

A:

That outcome applies to Dependency-ordered apply, intended to create an upstream object before a dependent reference is resolved, rather than the question's feature Apply the current configuration: Terraform uses references and explicit dependencies to order apply graph operations. Unlike Dependency-ordered apply, Apply the current configuration is intended to execute proposed operations after reviewing their impact, not to create an upstream object before a dependent reference is resolved.

C:

That outcome applies to Apply without interactive approval, intended to run a controlled automated deployment from current configuration, rather than the question's feature Apply the current configuration: terraform apply -auto-approve skips the interactive approval prompt for an unsaved plan. Unlike Apply without interactive approval, Apply the current configuration is intended to execute proposed operations after reviewing their impact, not to run a controlled automated deployment from current configuration.

D:

That outcome applies to Apply a previously saved plan, intended to execute precisely a previously generated binary execution plan, rather than the question's feature Apply the current configuration: terraform apply change.tfplan applies that saved plan rather than recalculating a fresh interactive plan. Unlike Apply a previously saved plan, Apply the current configuration is intended to execute proposed operations after reviewing their impact, not to execute precisely a previously generated binary execution plan.

Question 829

A technical review has three distinct objectives: use output from one service to configure another supported service; plan and apply resources from several providers in one run; and configure cloud and on-premises platforms through a common workflow. Which THREE mechanisms should the team identify for these respective needs? Choose THREE.

  1. Multi-cloud provider configuration
  2. Cross-platform dependency references
  3. Common Terraform lifecycle across providers
  4. Hybrid infrastructure automation
  5. Service-agnostic orchestration

Explanation

Correct Answers

B:

In the workflow combining use output from one service to configure another supported service, plan and apply resources from several providers in one run, and configure cloud and on-premises platforms through a common workflow, Cross-platform dependency references correctly addresses the individual goal to use output from one service to configure another supported service: References can establish ordering when a resource on one platform consumes attributes from another resource. It is one of three separately required capabilities.

C:

In the workflow combining use output from one service to configure another supported service, plan and apply resources from several providers in one run, and configure cloud and on-premises platforms through a common workflow, Common Terraform lifecycle across providers correctly addresses the individual goal to plan and apply resources from several providers in one run: Terraform Core constructs a dependency graph and asks installed providers to implement their own actions. It is one of three separately required capabilities.

D:

In the workflow combining use output from one service to configure another supported service, plan and apply resources from several providers in one run, and configure cloud and on-premises platforms through a common workflow, Hybrid infrastructure automation correctly addresses the individual goal to configure cloud and on-premises platforms through a common workflow: Terraform can coordinate providers for hosted services and private infrastructure without imposing one cloud API. It is one of three separately required capabilities.

Incorrect Answers

A:

Compared with the three tasks to use output from one service to configure another supported service, plan and apply resources from several providers in one run, and configure cloud and on-premises platforms through a common workflow, Multi-cloud provider configuration primarily supports an unrelated request to manage different clouds from one Terraform root module: Separate provider plugins can reconcile resources on multiple platforms within the same configuration. Therefore this option is not among the three specified mechanisms.

E:

Compared with the three tasks to use output from one service to configure another supported service, plan and apply resources from several providers in one run, and configure cloud and on-premises platforms through a common workflow, Service-agnostic orchestration primarily supports an unrelated request to control DNS, SaaS, and cloud resources through a common configuration tool: Terraform providers expose resource and data types beyond infrastructure hosted by a cloud vendor. Therefore this option is not among the three specified mechanisms.

Question 830

A Terraform rollout has two separate requirements: first, capture highly detailed events for a stubborn Terraform problem; second, review debugging evidence without publishing API secrets. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use TF_LOG environment variable; then use TF_LOG_PATH environment variable.
  2. First use TF_LOG_PATH environment variable; then use Log analysis and source protection.
  3. First use TRACE diagnostic level; then use Log analysis and source protection.
  4. First use Log analysis and source protection; then use TRACE diagnostic level.
  5. First use TRACE diagnostic level; then use TF_LOG environment variable.

Explanation

Correct Answer

C:

The first requirement, to capture highly detailed events for a stubborn Terraform problem, is handled by TRACE diagnostic level: TRACE is a very verbose Terraform logging level useful for deep troubleshooting. The second requirement, to review debugging evidence without publishing API secrets, is handled by Log analysis and source protection: Diagnostic logs should be stored and shared according to secret-handling policy. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to capture highly detailed events for a stubborn Terraform problem and review debugging evidence without publishing API secrets, the first candidate TF_LOG environment variable addresses enable Terraform debugging output while investigating a CLI failure; the second candidate TF_LOG_PATH environment variable addresses write Terraform debug logging to a named file. This mapping fails because the first mechanism primarily supports the task to enable Terraform debugging output while investigating a CLI failure and the second mechanism primarily supports the task to write Terraform debug logging to a named file; the actual requirements are capture highly detailed events for a stubborn Terraform problem first and review debugging evidence without publishing API secrets second.

B:

For the requested tasks to capture highly detailed events for a stubborn Terraform problem and review debugging evidence without publishing API secrets, the first candidate TF_LOG_PATH environment variable addresses write Terraform debug logging to a named file; the second candidate Log analysis and source protection addresses review debugging evidence without publishing API secrets. This mapping fails because the first mechanism primarily supports the task to write Terraform debug logging to a named file; the actual requirements are capture highly detailed events for a stubborn Terraform problem first and review debugging evidence without publishing API secrets second.

D:

For the requested tasks to capture highly detailed events for a stubborn Terraform problem and review debugging evidence without publishing API secrets, the first candidate Log analysis and source protection addresses review debugging evidence without publishing API secrets; the second candidate TRACE diagnostic level addresses capture highly detailed events for a stubborn Terraform problem. This mapping fails because the first mechanism primarily supports the task to review debugging evidence without publishing API secrets and the second mechanism primarily supports the task to capture highly detailed events for a stubborn Terraform problem; the actual requirements are capture highly detailed events for a stubborn Terraform problem first and review debugging evidence without publishing API secrets second.

E:

For the requested tasks to capture highly detailed events for a stubborn Terraform problem and review debugging evidence without publishing API secrets, the first candidate TRACE diagnostic level addresses capture highly detailed events for a stubborn Terraform problem; the second candidate TF_LOG environment variable addresses enable Terraform debugging output while investigating a CLI failure. This mapping fails because the second mechanism primarily supports the task to enable Terraform debugging output while investigating a CLI failure; the actual requirements are capture highly detailed events for a stubborn Terraform problem first and review debugging evidence without publishing API secrets second.

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