100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 190
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A root module contains a new variable validation rule, and an engineer wants to check the HCL before accessing cloud credentials. and Workstream B: A deployment calls a reusable module with count = 3 and must reference the output of only the second instance. and Workstream C: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. Select exactly 3 actions, one addressing each distinct workstream.
- Declare the child's input variable and pass subnet_ids explicitly through its module block arguments.
- Define a root output whose value references the managed load balancer's endpoint attribute.
- Create an appropriately scoped HCP Terraform variable set applied to those project workspaces.
- Use terraform validate for the initialized configuration, then separately test variable values during a plan.
- Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying.
- Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression.
Explanation
Correct Answers
C:For the workstream in which a platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project, use this action: Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Variable sets centralize shared configuration at project or organization scope. Verify: New and existing workspaces in the project receive the intended shared variable. Limitation: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins.
D:For the workstream in which a root module contains a new variable validation rule, and an engineer wants to check the HCL before accessing cloud credentials, use this action: Use terraform validate for the initialized configuration, then separately test variable values during a plan. Static correctness and input-specific conditions operate at different evaluation times. Verify: Static validation succeeds and an invalid supplied input is rejected at the stage where its custom condition is evaluated. Limitation: Some custom conditions depend on actual input or resource values and cannot all be exercised by validate alone.
F:For the workstream in which a deployment calls a reusable module with count = 3 and must reference the output of only the second instance, use this action: Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression. Counted module calls use numeric instance indices. Verify: The plan resolves the output for the intended counted module instance. Limitation: Changing count or order can affect addresses and cause unintended replacements.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A child module expects a variable named subnet_ids, but the calling root references an undeclared variable from inside the child. It would be checked by: The child's configuration validates and resolves the provided subnet IDs in its own scope. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
B:This action is appropriate instead for a different, unlisted requirement: An operations team must surface a load balancer endpoint after apply so downstream jobs can consume it. It would be checked by: After apply, terraform output reports the expected endpoint from state. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
E:This action is appropriate instead for a different, unlisted requirement: A university repeats a six-network, three-environment build by copying screenshots of console clicks, and auditors cannot reconstruct which settings produced the last deployment. It would be checked by: A fresh environment can be planned from the same versioned configuration and its intended change set reviewed. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 191
An infrastructure team faces this specific situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. Which Terraform action most directly satisfies the requirement?
- Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone.
- Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
- Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan.
- Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported.
Explanation
Correct Answer
B:Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Resource blocks manage lifecycle; data blocks query information without taking lifecycle ownership of the queried object. Verify: Plan distinguishes a create action from a read-only query of the existing network. Limitation: The data source requires access and will fail if its lookup criteria match no suitable object.
Incorrect Answers
A:This is linked to a different situation: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. There the relevant decision is: Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant decision is: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. There the relevant decision is: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant decision is: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A company rotates application credentials in Vault and wants Terraform pipelines to avoid checking decrypted secrets into source control. There the relevant decision is: Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant decision is: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. It would therefore not resolve or assess the case as stated.
Question 192
A reviewer is confirming a change for the following use case: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. The implementation follows this approach: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Which observation or acceptance test most directly verifies the intended result?
- Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.
- Plan distinguishes a create action from a read-only query of the existing network.
- A failed check appears as a diagnostic rather than necessarily blocking the run like a precondition.
- The resource operation consumes the password while the Terraform plan and state omit the write-only value.
Explanation
Correct Answer
B:Acceptance evidence: Plan distinguishes a create action from a read-only query of the existing network. It validates the proposed action, declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup, because resource blocks manage lifecycle; data blocks query information without taking lifecycle ownership of the queried object. Remaining limitation: The data source requires access and will fail if its lookup criteria match no suitable object.
Incorrect Answers
A:This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant acceptance is: Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant acceptance is: Plan distinguishes a create action from a read-only query of the existing network. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An operations group wants an infrastructure health assertion that can report a diagnostic without behaving exactly like a resource precondition. There the relevant acceptance is: A failed check appears as a diagnostic rather than necessarily blocking the run like a precondition. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant acceptance is: Plan distinguishes a create action from a read-only query of the existing network. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. There the relevant acceptance is: The resource operation consumes the password while the Terraform plan and state omit the write-only value. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant acceptance is: Plan distinguishes a create action from a read-only query of the existing network. It would therefore not resolve or assess the case as stated.
Question 193
Consider a proposed solution for this requirement: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. The team plans to do the following: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Which limitation or operational caveat must remain in the review?
- Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later.
- A missing map key causes an expression error unless a default is explicitly handled.
- sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state.
- The data source requires access and will fail if its lookup criteria match no suitable object.
Explanation
Correct Answer
D:The limitation is the data source requires access and will fail if its lookup criteria match no suitable object. The proposed change is declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Validate it by checking plan distinguishes a create action from a read-only query of the existing network. Resource blocks manage lifecycle; data blocks query information without taking lifecycle ownership of the queried object.
Incorrect Answers
A:This is linked to a different situation: A managed service should not continue to downstream provisioning if the returned endpoint has an invalid structure. There the relevant limitation is: Postconditions evaluate values at the appropriate stage; a result that is unknown at plan may be checked later. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant limitation is: The data source requires access and will fail if its lookup criteria match no suitable object. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A configuration needs a map from environment names to individually selected instance classes, with each value a string. There the relevant limitation is: A missing map key causes an expression error unless a default is explicitly handled. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant limitation is: The data source requires access and will fail if its lookup criteria match no suitable object. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. There the relevant limitation is: sensitive primarily redacts normal CLI display; it does not by itself exclude a value from state. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant limitation is: The data source requires access and will fail if its lookup criteria match no suitable object. It would therefore not resolve or assess the case as stated.
Question 194
The team is reviewing a Terraform implementation for this case: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Assume prevent_destroy continues to protect an object after the containing resource block is deleted.
- Declare a variable named endpoint and assume it automatically exports the created object's address.
- Use a resource declaration for the shared network and assume Terraform only reads it.
- Treat an unrelated output value as though it automatically becomes a resource precondition.
Explanation
Correct Answer
C:Reject the assumption: Use a resource declaration for the shared network and assume Terraform only reads it. Instead, declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Resource blocks manage lifecycle; data blocks query information without taking lifecycle ownership of the queried object. Acceptance evidence: Plan distinguishes a create action from a read-only query of the existing network.
Incorrect Answers
A:This is linked to a different situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. There the relevant misconception is: Assume prevent_destroy continues to protect an object after the containing resource block is deleted. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant misconception is: Use a resource declaration for the shared network and assume Terraform only reads it. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: An operations team must surface a load balancer endpoint after apply so downstream jobs can consume it. There the relevant misconception is: Declare a variable named endpoint and assume it automatically exports the created object's address. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant misconception is: Use a resource declaration for the shared network and assume Terraform only reads it. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A team must verify a network policy's expected input range before taking an action that would violate the rule. There the relevant misconception is: Treat an unrelated output value as though it automatically becomes a resource precondition. For the question's actual requirement — A web team must create a new load balancer and also look up an existing shared network ID managed by another team. — the specifically relevant misconception is: Use a resource declaration for the shared network and assume Terraform only reads it. It would therefore not resolve or assess the case as stated.
Question 195
A Terraform platform team is coordinating 2 independent decisions. Workstream A: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. and Workstream B: A module is instantiated for each environment in a map, and the root needs the output for the test environment. Select exactly 2 actions, one addressing each distinct workstream.
- Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
- Review the generated plan and approve the apply prompt only if the changes are intended.
- Let the state lock serialize operations and retry after the active writer finishes.
- Use for_each on the module block and reference module.stack["test"].endpoint.
- Run terraform apply release.tfplan under authorized credentials and the correct backend.
Explanation
Correct Answers
A:For the workstream in which a web team must create a new load balancer and also look up an existing shared network ID managed by another team, use this action: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Resource blocks manage lifecycle; data blocks query information without taking lifecycle ownership of the queried object. Verify: Plan distinguishes a create action from a read-only query of the existing network. Limitation: The data source requires access and will fail if its lookup criteria match no suitable object.
D:For the workstream in which a module is instantiated for each environment in a map, and the root needs the output for the test environment, use this action: Use for_each on the module block and reference module.stack["test"].endpoint. Keyed module instances maintain clear logical addressing. Verify: The keyed module instance exposes only the test environment's selected output. Limitation: Renaming the test key is an address change unless state moves are handled.
Incorrect Answers
B:This option addresses a separate requirement: A developer executes terraform apply interactively without a plan file and sees a proposed change summary. Evidence for that other requirement would be the apply command waits for confirmation before changing resources in normal interactive use; neither listed workstream asks for it.
C:This option addresses a separate requirement: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. Evidence for that other requirement would be only one run modifies the protected state at a time and the second safely waits or fails; neither listed workstream asks for it.
E:This option addresses a separate requirement: A signed-off infrastructure change has a saved plan artifact and the team needs to execute exactly that reviewed action set. Evidence for that other requirement would be terraform performs the saved proposed resource actions and updates state when successful; neither listed workstream asks for it.
Question 196
An infrastructure team faces this specific situation: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. Which Terraform action most directly satisfies the requirement?
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
- Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone.
- Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan.
- Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted.
Explanation
Correct Answer
B:Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. A data source reads provider information rather than creating a resource state binding for lifecycle ownership. Verify: Destroy plans do not include deleting an object solely because a data block queried it. Limitation: Converting a shared data lookup to a managed resource demands an ownership and import decision.
Incorrect Answers
A:This is linked to a different situation: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. There the relevant decision is: Index the resource collection by its actual for_each key rather than assuming numeric list positions. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant decision is: Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. There the relevant decision is: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant decision is: Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A service cannot tolerate downtime when replacing a VM and the provider's planned operation requires destroy-and-create. There the relevant decision is: Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant decision is: Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. It would therefore not resolve or assess the case as stated.
Question 197
A reviewer is confirming a change for the following use case: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. The implementation follows this approach: Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. Which observation or acceptance test most directly verifies the intended result?
- The computed list contains each intended service name normalized consistently.
- Destroy plans do not include deleting an object solely because a data block queried it.
- The first, second, and third output elements correspond to documented ordered subnet assignments.
- Repeated port values collapse to unique members without relying on list positions.
Explanation
Correct Answer
B:Acceptance evidence: Destroy plans do not include deleting an object solely because a data block queried it. It validates the proposed action, manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone, because a data source reads provider information rather than creating a resource state binding for lifecycle ownership. Remaining limitation: Converting a shared data lookup to a managed resource demands an ownership and import decision.
Incorrect Answers
A:This is linked to a different situation: A pipeline produces a list of service names with inconsistent letter casing and needs normalized DNS labels. There the relevant acceptance is: The computed list contains each intended service name normalized consistently. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant acceptance is: Destroy plans do not include deleting an object solely because a data block queried it. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. There the relevant acceptance is: The first, second, and third output elements correspond to documented ordered subnet assignments. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant acceptance is: Destroy plans do not include deleting an object solely because a data block queried it. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. There the relevant acceptance is: Repeated port values collapse to unique members without relying on list positions. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant acceptance is: Destroy plans do not include deleting an object solely because a data block queried it. It would therefore not resolve or assess the case as stated.
Question 198
Consider a proposed solution for this requirement: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. The team plans to do the following: Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. Which limitation or operational caveat must remain in the review?
- Converting a shared data lookup to a managed resource demands an ownership and import decision.
- Both branches need compatible types and the condition must be a boolean expression.
- A missing map key causes an expression error unless a default is explicitly handled.
- Explicit dependencies should be limited to real hidden dependencies; excessive depends_on can make plans conservative.
Explanation
Correct Answer
A:The limitation is converting a shared data lookup to a managed resource demands an ownership and import decision. The proposed change is manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. Validate it by checking destroy plans do not include deleting an object solely because a data block queried it. A data source reads provider information rather than creating a resource state binding for lifecycle ownership.
Incorrect Answers
B:This is linked to a different situation: A deployment needs to choose a service hostname based on whether the environment is production. There the relevant limitation is: Both branches need compatible types and the condition must be a boolean expression. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant limitation is: Converting a shared data lookup to a managed resource demands an ownership and import decision. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A configuration needs a map from environment names to individually selected instance classes, with each value a string. There the relevant limitation is: A missing map key causes an expression error unless a default is explicitly handled. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant limitation is: Converting a shared data lookup to a managed resource demands an ownership and import decision. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A firewall rule should be provisioned only after a policy attachment exists, but the rule's arguments do not reference that attachment. There the relevant limitation is: Explicit dependencies should be limited to real hidden dependencies; excessive depends_on can make plans conservative. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant limitation is: Converting a shared data lookup to a managed resource demands an ownership and import decision. It would therefore not resolve or assess the case as stated.
Question 199
The team is reviewing a Terraform implementation for this case: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Assume any object named in a data block is subject to resource deletion on destroy.
- Assume create_before_destroy guarantees zero downtime even when duplicate names are forbidden.
- Set ephemeral=true on a variable and then use it freely in any ordinary output persisted to state.
- Disable state refresh entirely as the permanent way to share control of a single attribute.
Explanation
Correct Answer
A:Reject the assumption: Assume any object named in a data block is subject to resource deletion on destroy. Instead, manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. A data source reads provider information rather than creating a resource state binding for lifecycle ownership. Acceptance evidence: Destroy plans do not include deleting an object solely because a data block queried it.
Incorrect Answers
B:This is linked to a different situation: A service cannot tolerate downtime when replacing a VM and the provider's planned operation requires destroy-and-create. There the relevant misconception is: Assume create_before_destroy guarantees zero downtime even when duplicate names are forbidden. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant misconception is: Assume any object named in a data block is subject to resource deletion on destroy. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A short-lived token must be used during an operation, and auditors require that the token not be written to a plan file. There the relevant misconception is: Set ephemeral=true on a variable and then use it freely in any ordinary output persisted to state. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant misconception is: Assume any object named in a data block is subject to resource deletion on destroy. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A managed resource's tag is updated by an external compliance agent, and Terraform must not revert only that tag on every plan. There the relevant misconception is: Disable state refresh entirely as the permanent way to share control of a single attribute. For the question's actual requirement — An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. — the specifically relevant misconception is: Assume any object named in a data block is subject to resource deletion on destroy. It would therefore not resolve or assess the case as stated.
Question 200
A Terraform platform team is coordinating 3 independent decisions. Workstream A: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. and Workstream B: A child module must receive two non-default provider aliases for cross-region VPN creation. and Workstream C: A team needs one shared network workspace to finish before dependent application workspaces start their own updates. Select exactly 3 actions, one addressing each distinct workstream.
- Use an appropriate moved block to preserve the instance's state address during the refactor.
- Use suitable HCP Terraform workspace run triggers where supported to coordinate dependent runs.
- Run terraform fmt -recursive on the intended directory tree after reviewing the file scope.
- Declare aliases in the child required_providers and explicitly pass both in the parent module.providers mapping.
- Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.
- Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone.
Explanation
Correct Answers
B:For the workstream in which a team needs one shared network workspace to finish before dependent application workspaces start their own updates, use this action: Use suitable HCP Terraform workspace run triggers where supported to coordinate dependent runs. Workspace run triggers support sequencing while keeping workspace state boundaries separate. Verify: A successful upstream application can queue the configured downstream workspace run. Limitation: Run triggers coordinate workspace runs but do not automatically express every cross-workspace data dependency.
D:For the workstream in which a child module must receive two non-default provider aliases for cross-region VPN creation, use this action: Declare aliases in the child required_providers and explicitly pass both in the parent module.providers mapping. Cross-region reusable modules should receive provider configurations from the caller. Verify: The child's plan uses the two exact provider instances rather than silently defaulting to one region. Limitation: An alias without a corresponding provider mapping is not inherited automatically.
F:For the workstream in which an engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy, use this action: Manage lifecycle through an explicit resource binding only if ownership is intended; a data source alone cannot delete the looked-up zone. A data source reads provider information rather than creating a resource state binding for lifecycle ownership. Verify: Destroy plans do not include deleting an object solely because a data block queried it. Limitation: Converting a shared data lookup to a managed resource demands an ownership and import decision.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A resource was renamed from aws_instance.app to aws_instance.frontend in HCL, but it is the same underlying VM. It would be checked by: The plan reports an address move instead of unnecessary destruction and recreation. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
C:This action is appropriate instead for a different, unlisted requirement: A developer needs to format all Terraform files in nested module directories as part of a repository cleanup. It would be checked by: The command rewrites formatting of Terraform configuration files in nested directories. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
E:This action is appropriate instead for a different, unlisted requirement: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. It would be checked by: Both operators observe the same resource addresses and coordinated state updates. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests