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

Question 870

Before continuing an infrastructure rollout, the operator must detect an impossible dependency ordering caused by circular references. Which mechanism most directly meets this particular need?

  1. Explicit depends_on relationship
  2. Terraform resource graph cycle
  3. create_before_destroy lifecycle
  4. prevent_destroy lifecycle
  5. Implicit dependency from expression

Explanation

Correct Answer

B:

The task is to detect an impossible dependency ordering caused by circular references; Terraform resource graph cycle directly supports that requirement: Terraform reports cycles when resources depend on one another in a way it cannot order. Its relevant boundary is: Changing file order does not resolve a cyclic dependency graph.

Incorrect Answers

A:

Explicit depends_on relationship is designed to order otherwise unreferenced actions that have a hidden operational dependency, whereas this task is to detect an impossible dependency ordering caused by circular references: depends_on declares an ordering relationship when there is no suitable value reference. Against Terraform resource graph cycle, its limitation is: Excessive explicit dependencies can make planning conservative and values unknown.

C:

create_before_destroy lifecycle is designed to favor replacement resource creation before deletion of its predecessor, whereas this task is to detect an impossible dependency ordering caused by circular references: The lifecycle rule changes replacement ordering when the provider and external constraints permit it. Against Terraform resource graph cycle, its limitation is: A uniqueness constraint or quota can still prevent parallel old and new objects.

D:

prevent_destroy lifecycle is designed to protect a declared resource from plans that destroy its managed object, whereas this task is to detect an impossible dependency ordering caused by circular references: prevent_destroy causes an error if a plan includes destruction while the rule is present in configuration. Against Terraform resource graph cycle, its limitation is: Removing the entire resource configuration also removes this protective rule.

E:

Implicit dependency from expression is designed to order resources when one consumes an attribute produced by another, whereas this task is to detect an impossible dependency ordering caused by circular references: Terraform derives an edge from an expression reference and schedules the producer first. Against Terraform resource graph cycle, its limitation is: No extra depends_on is needed for an already represented relationship.

Question 871

The implementation must both run a controlled automated deployment from current configuration and record the result of successful provider operations for subsequent reconciliation. Which TWO mechanisms directly address these two separate requirements? Choose TWO.

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

Explanation

Correct Answers

A:

Among the paired tasks to run a controlled automated deployment from current configuration and record the result of successful provider operations for subsequent reconciliation, Apply without interactive approval serves the requirement to run a controlled automated deployment from current configuration: terraform apply -auto-approve skips the interactive approval prompt for an unsaved plan. The other task must be covered by a separate mechanism.

B:

Among the paired tasks to run a controlled automated deployment from current configuration and record the result of successful provider operations for subsequent reconciliation, Updated state after apply serves the requirement to record the result of successful provider operations for subsequent reconciliation: Terraform persists state reflecting actions and known attributes after apply operations. The other task must be covered by a separate mechanism.

Incorrect Answers

C:

The requirements are run a controlled automated deployment from current configuration and record the result of successful provider operations for subsequent reconciliation, while Dependency-ordered apply supports the different task to create an upstream object before a dependent reference is resolved: Terraform uses references and explicit dependencies to order apply graph operations. That capability is outside the two selected responsibilities.

D:

The requirements are run a controlled automated deployment from current configuration and record the result of successful provider operations for subsequent reconciliation, while Apply the current configuration supports the different task to execute proposed operations after reviewing their impact: terraform apply normally creates a plan and asks for approval before making changes. That capability is outside the two selected responsibilities.

E:

The requirements are run a controlled automated deployment from current configuration and record the result of successful provider operations for subsequent reconciliation, while Apply a previously saved plan supports the different task to execute precisely a previously generated binary execution plan: terraform apply change.tfplan applies that saved plan rather than recalculating a fresh interactive plan. That capability is outside the two selected responsibilities.

Question 872

The team is documenting risks of Multiple regions in one configuration while planning to create similar resources in different regions without duplicating the root module. Which caveat specifically applies to that mechanism?

  1. A default provider does not infer a resource's desired region from its name.
  2. Resources still use their provider-defined schemas and credentials.
  3. The alias must be declared and satisfy provider requirements.
  4. The existence of an alias does not move existing resources to that configuration automatically.

Explanation

Correct Answer

A:

For Multiple regions in one configuration in the task to create similar resources in different regions without duplicating the root module, the important caution is: A default provider does not infer a resource's desired region from its name. The reason this matters is its actual behavior: Two provider instances with different region settings can serve explicitly assigned resources or modules.

Incorrect Answers

B:

The proposed warning belongs to Different provider local names, which serves the different goal to declare several provider types in the same root module, rather than to Multiple regions in one configuration: The required_providers map can list multiple source addresses with distinct local names. The question concerns Multiple regions in one configuration acting to create similar resources in different regions without duplicating the root module, not a limit of Different provider local names.

C:

The proposed warning belongs to Resource provider meta-argument, which serves the different goal to direct an individual resource to the intended aliased provider, rather than to Multiple regions in one configuration: The provider meta-argument can select a configured instance such as aws.west for that resource. The question concerns Multiple regions in one configuration acting to create similar resources in different regions without duplicating the root module, not a limit of Resource provider meta-argument.

D:

The proposed warning belongs to Aliased provider instance, which serves the different goal to configure a second instance of the same provider for another account or region, rather than to Multiple regions in one configuration: The alias argument gives a provider configuration an additional address that resources can select. The question concerns Multiple regions in one configuration acting to create similar resources in different regions without duplicating the root module, not a limit of Aliased provider instance.

Question 873

A configuration walkthrough identifies "Terraform resource graph cycle". Which task is it principally intended to support?

  1. detect an impossible dependency ordering caused by circular references
  2. order otherwise unreferenced actions that have a hidden operational dependency
  3. favor replacement resource creation before deletion of its predecessor
  4. order resources when one consumes an attribute produced by another

Explanation

Correct Answer

A:

The practical result of Terraform resource graph cycle, used to detect an impossible dependency ordering caused by circular references, is: Terraform reports cycles when resources depend on one another in a way it cannot order. A qualification for this effect is: Changing file order does not resolve a cyclic dependency graph.

Incorrect Answers

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 Terraform resource graph cycle: depends_on declares an ordering relationship when there is no suitable value reference. Unlike Explicit depends_on relationship, Terraform resource graph cycle is intended to detect an impossible dependency ordering caused by circular references, not to order otherwise unreferenced actions that have a hidden operational dependency.

C:

That outcome applies to create_before_destroy lifecycle, intended to favor replacement resource creation before deletion of its predecessor, rather than the question's feature Terraform resource graph cycle: The lifecycle rule changes replacement ordering when the provider and external constraints permit it. Unlike create_before_destroy lifecycle, Terraform resource graph cycle is intended to detect an impossible dependency ordering caused by circular references, not to favor replacement resource creation before deletion of its predecessor.

D:

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 Terraform resource graph cycle: Terraform derives an edge from an expression reference and schedules the producer first. Unlike Implicit dependency from expression, Terraform resource graph cycle is intended to detect an impossible dependency ordering caused by circular references, not to order resources when one consumes an attribute produced by another.

Question 874

A change proposal relies on Common Terraform lifecycle across providers for the task to plan and apply resources from several providers in one run. Which limitation specifically applies to it?

  1. Replacing a cloud provider normally requires rewriting provider-dependent resources.
  2. A unified plan cannot guarantee a distributed transaction across separate providers.
  3. A resource type from one provider cannot be substituted blindly for another.
  4. Each provider still needs suitable credentials and service permissions.

Explanation

Correct Answer

B:

For Common Terraform lifecycle across providers in the task to plan and apply resources from several providers in one run, the important caution is: A unified plan cannot guarantee a distributed transaction across separate providers. The reason this matters is its actual behavior: Terraform Core constructs a dependency graph and asks installed providers to implement their own actions.

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 Common Terraform lifecycle across providers: A module can offer common input and output conventions even if its implementation uses provider-specific resources. The question concerns Common Terraform lifecycle across providers acting to plan and apply resources from several providers in one run, not a limit of Vendor portability through modules.

C:

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 Common Terraform lifecycle across providers: HCL and workflow are common while each provider defines its own resource schema and service-specific behavior. The question concerns Common Terraform lifecycle across providers acting to plan and apply resources from several providers in one run, not a limit of Provider-specific implementation.

D:

The listed caution belongs specifically to Multi-cloud provider configuration, used to manage different clouds from one Terraform root module: Separate provider plugins can reconcile resources on multiple platforms within the same configuration; the feature under review is instead Common Terraform lifecycle across providers, so this answer attaches another feature's qualification to the wrong mechanism.

Question 875

A change proposal relies on Log analysis and source protection for the task to review debugging evidence without publishing API secrets. Which limitation specifically applies to it?

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

Explanation

Correct Answer

E:

For Log analysis and source protection in the task to review debugging evidence without publishing API secrets, the important caution is: A log that shows an error does not automatically identify the root cause without context. The reason this matters is its actual behavior: Diagnostic logs should be stored and shared according to secret-handling policy.

Incorrect Answers

A:

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 Log analysis and source protection: Unset debug environment variables or restore normal log settings when the investigation ends. The question concerns Log analysis and source protection acting to review debugging evidence without publishing API secrets, not a limit of Disable debug logging after diagnosis.

B:

The proposed warning belongs to TF_LOG environment variable, which serves the different goal to enable Terraform debugging output while investigating a CLI failure, rather than to Log analysis and source protection: TF_LOG sets a supported logging level such as DEBUG or TRACE for a Terraform process. The question concerns Log analysis and source protection acting to review debugging evidence without publishing API secrets, not a limit of TF_LOG environment variable.

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 Log analysis and source protection: TF_LOG_PROVIDER controls the provider logging level to aid plugin or API troubleshooting. The question concerns Log analysis and source protection acting to review debugging evidence without publishing API secrets, not a limit of TF_LOG_PROVIDER environment variable.

D:

The proposed warning belongs to TRACE diagnostic level, which serves the different goal to capture highly detailed events for a stubborn Terraform problem, rather than to Log analysis and source protection: TRACE is a very verbose Terraform logging level useful for deep troubleshooting. The question concerns Log analysis and source protection acting to review debugging evidence without publishing API secrets, not a limit of TRACE diagnostic level.

Question 876

In a reusable deployment, the primary objective is to create an upstream object before a dependent reference is resolved. Which mechanism most directly meets this particular need?

  1. Apply variable overrides
  2. Updated state after apply
  3. Apply failure diagnosis
  4. Dependency-ordered apply

Explanation

Correct Answer

D:

The task is to create an upstream object before a dependent reference is resolved; Dependency-ordered apply directly supports that requirement: Terraform uses references and explicit dependencies to order apply graph operations. Its relevant boundary is: The order is not determined by the placement of resource blocks in files.

Incorrect Answers

A:

Apply variable overrides is designed to set an input variable for a particular deployment without editing its declaration, whereas this task is to create an upstream object before a dependent reference is resolved: terraform apply -var='name=value' supplies root-module input during that run. Against Dependency-ordered apply, its limitation is: The same variable inputs must be accounted for when using a saved plan.

B:

Updated state after apply is designed to record the result of successful provider operations for subsequent reconciliation, whereas this task is to create an upstream object before a dependent reference is resolved: Terraform persists state reflecting actions and known attributes after apply operations. Against Dependency-ordered apply, its limitation is: A partial failure can leave partial changes requiring another plan and review.

C:

Apply failure diagnosis is designed to rerun a plan after a partial apply rather than assuming complete rollback, whereas this task is to create an upstream object before a dependent reference is resolved: Terraform does not guarantee all-or-nothing rollback across external provider APIs. Against Dependency-ordered apply, its limitation is: Inspecting real objects and current state is necessary after a failed apply.

Question 877

A design uses Terraform resource graph cycle to detect an impossible dependency ordering caused by circular references. Which qualification applies to the named mechanism?

  1. Removing the entire resource configuration also removes this protective rule.
  2. No extra depends_on is needed for an already represented relationship.
  3. Changing file order does not resolve a cyclic dependency graph.
  4. A uniqueness constraint or quota can still prevent parallel old and new objects.
  5. Excessive explicit dependencies can make planning conservative and values unknown.

Explanation

Correct Answer

C:

For Terraform resource graph cycle in the task to detect an impossible dependency ordering caused by circular references, the important caution is: Changing file order does not resolve a cyclic dependency graph. The reason this matters is its actual behavior: Terraform reports cycles when resources depend on one another in a way it cannot order.

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 Terraform resource graph cycle: prevent_destroy causes an error if a plan includes destruction while the rule is present in configuration. The question concerns Terraform resource graph cycle acting to detect an impossible dependency ordering caused by circular references, not a limit of prevent_destroy lifecycle.

B:

The proposed warning belongs to Implicit dependency from expression, which serves the different goal to order resources when one consumes an attribute produced by another, rather than to Terraform resource graph cycle: Terraform derives an edge from an expression reference and schedules the producer first. The question concerns Terraform resource graph cycle acting to detect an impossible dependency ordering caused by circular references, not a limit of Implicit dependency from expression.

D:

The proposed warning belongs to create_before_destroy lifecycle, which serves the different goal to favor replacement resource creation before deletion of its predecessor, rather than to Terraform resource graph cycle: The lifecycle rule changes replacement ordering when the provider and external constraints permit it. The question concerns Terraform resource graph cycle acting to detect an impossible dependency ordering caused by circular references, not a limit of create_before_destroy lifecycle.

E:

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 Terraform resource graph cycle: depends_on declares an ordering relationship when there is no suitable value reference. The question concerns Terraform resource graph cycle acting to detect an impossible dependency ordering caused by circular references, not a limit of Explicit depends_on relationship.

Question 878

A Terraform rollout has two separate requirements: first, create similar resources in different regions without duplicating the root module; second, direct an individual resource to the intended aliased provider. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use Different provider local names; then use Explicit child module provider mapping.
  2. First use Multiple regions in one configuration; then use Different provider local names.
  3. First use Multiple regions in one configuration; then use Resource provider meta-argument.
  4. First use Resource provider meta-argument; then use Multiple regions in one configuration.
  5. First use Explicit child module provider mapping; then use Resource provider meta-argument.

Explanation

Correct Answer

C:

The first requirement, to create similar resources in different regions without duplicating the root module, is handled by Multiple regions in one configuration: Two provider instances with different region settings can serve explicitly assigned resources or modules. The second requirement, to direct an individual resource to the intended aliased provider, is handled by Resource provider meta-argument: The provider meta-argument can select a configured instance such as aws.west for that resource. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to create similar resources in different regions without duplicating the root module and direct an individual resource to the intended aliased provider, the first candidate Different provider local names addresses declare several provider types in the same root module; the second candidate Explicit child module provider mapping addresses pass an aliased provider to resources inside a child module. This mapping fails because the first mechanism primarily supports the task to declare several provider types in the same root module and the second mechanism primarily supports the task to pass an aliased provider to resources inside a child module; the actual requirements are create similar resources in different regions without duplicating the root module first and direct an individual resource to the intended aliased provider second.

B:

For the requested tasks to create similar resources in different regions without duplicating the root module and direct an individual resource to the intended aliased provider, the first candidate Multiple regions in one configuration addresses create similar resources in different regions without duplicating the root module; the second candidate Different provider local names addresses declare several provider types in the same root module. This mapping fails because the second mechanism primarily supports the task to declare several provider types in the same root module; the actual requirements are create similar resources in different regions without duplicating the root module first and direct an individual resource to the intended aliased provider second.

D:

For the requested tasks to create similar resources in different regions without duplicating the root module and direct an individual resource to the intended aliased provider, the first candidate Resource provider meta-argument addresses direct an individual resource to the intended aliased provider; the second candidate Multiple regions in one configuration addresses create similar resources in different regions without duplicating the root module. This mapping fails because the first mechanism primarily supports the task to direct an individual resource to the intended aliased provider and the second mechanism primarily supports the task to create similar resources in different regions without duplicating the root module; the actual requirements are create similar resources in different regions without duplicating the root module first and direct an individual resource to the intended aliased provider second.

E:

For the requested tasks to create similar resources in different regions without duplicating the root module and direct an individual resource to the intended aliased provider, the first candidate Explicit child module provider mapping addresses pass an aliased provider to resources inside a child module; the second candidate Resource provider meta-argument addresses direct an individual resource to the intended aliased provider. This mapping fails because the first mechanism primarily supports the task to pass an aliased provider to resources inside a child module; the actual requirements are create similar resources in different regions without duplicating the root module first and direct an individual resource to the intended aliased provider second.

Question 879

The implementation must both detect an impossible dependency ordering caused by circular references and order otherwise unreferenced actions that have a hidden operational dependency. Which TWO mechanisms directly address these two separate requirements? Choose TWO.

  1. Terraform resource graph cycle
  2. Implicit dependency from expression
  3. Explicit depends_on relationship
  4. prevent_destroy lifecycle
  5. ignore_changes lifecycle

Explanation

Correct Answers

A:

Among the paired tasks to detect an impossible dependency ordering caused by circular references and order otherwise unreferenced actions that have a hidden operational dependency, Terraform resource graph cycle serves the requirement to detect an impossible dependency ordering caused by circular references: Terraform reports cycles when resources depend on one another in a way it cannot order. The other task must be covered by a separate mechanism.

C:

Among the paired tasks to detect an impossible dependency ordering caused by circular references and order otherwise unreferenced actions that have a hidden operational dependency, 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.

Incorrect Answers

B:

The requirements are detect an impossible dependency ordering caused by circular references and order otherwise unreferenced actions that have a hidden operational dependency, 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.

D:

The requirements are detect an impossible dependency ordering caused by circular references and order otherwise unreferenced actions that have a hidden operational dependency, while prevent_destroy lifecycle supports the different task 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. That capability is outside the two selected responsibilities.

E:

The requested tasks are to detect an impossible dependency ordering caused by circular references; order otherwise unreferenced actions that have a hidden operational dependency, but ignore_changes lifecycle primarily addresses the different goal to suppress planned updates for selected externally managed attributes: ignore_changes tells Terraform to disregard specified differences when planning updates to an existing resource; therefore it is not one of the mechanisms selected for the stated requirements.

Question 880

A Terraform runbook describes the mechanism "Dependency-ordered apply". Which responsibility should a reviewer associate with it?

  1. execute proposed operations after reviewing their impact
  2. create an upstream object before a dependent reference is resolved
  3. set an input variable for a particular deployment without editing its declaration
  4. record the result of successful provider operations for subsequent reconciliation
  5. rerun a plan after a partial apply rather than assuming complete rollback

Explanation

Correct Answer

B:

The practical result of Dependency-ordered apply, used to create an upstream object before a dependent reference is resolved, is: Terraform uses references and explicit dependencies to order apply graph operations. A qualification for this effect is: The order is not determined by the placement of resource blocks in files.

Incorrect Answers

A:

That outcome applies to Apply the current configuration, intended to execute proposed operations after reviewing their impact, rather than the question's feature Dependency-ordered apply: terraform apply normally creates a plan and asks for approval before making changes. Unlike Apply the current configuration, Dependency-ordered apply is intended to create an upstream object before a dependent reference is resolved, not to execute proposed operations after reviewing their impact.

C:

That outcome applies to Apply variable overrides, intended to set an input variable for a particular deployment without editing its declaration, rather than the question's feature Dependency-ordered apply: terraform apply -var='name=value' supplies root-module input during that run. Unlike Apply variable overrides, Dependency-ordered apply is intended to create an upstream object before a dependent reference is resolved, not to set an input variable for a particular deployment without editing its declaration.

D:

That outcome applies to Updated state after apply, intended to record the result of successful provider operations for subsequent reconciliation, rather than the question's feature Dependency-ordered apply: Terraform persists state reflecting actions and known attributes after apply operations. Unlike Updated state after apply, Dependency-ordered apply is intended to create an upstream object before a dependent reference is resolved, not to record the result of successful provider operations for subsequent reconciliation.

E:

That outcome applies to Apply failure diagnosis, intended to rerun a plan after a partial apply rather than assuming complete rollback, rather than the question's feature Dependency-ordered apply: Terraform does not guarantee all-or-nothing rollback across external provider APIs. Unlike Apply failure diagnosis, Dependency-ordered apply is intended to create an upstream object before a dependent reference is resolved, not to rerun a plan after a partial apply rather than assuming complete rollback.

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