100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 210
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. and Workstream B: A registry module release contains an urgent fix and the team's installed module is still the previous compatible release. and Workstream C: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. Select exactly 3 actions, one addressing each distinct workstream.
- Review the intended registry release and run terraform init -upgrade after updating constraints as needed.
- Explain that Terraform compares current configuration with state bindings and plans to reconcile deleted declarations.
- Reuse one reviewed Terraform module with explicit environment inputs instead of independently editing each deployment.
- Reference the security group resource attribute directly from the database argument.
- Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization.
- Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias.
Explanation
Correct Answers
A:For the workstream in which a registry module release contains an urgent fix and the team's installed module is still the previous compatible release, use this action: Review the intended registry release and run terraform init -upgrade after updating constraints as needed. Module upgrade changes downloaded code, not state ownership by itself. Verify: The initialized module source matches the new permitted version and the resulting plan is reviewed. Limitation: An upgrade may change resources and output interfaces; it needs an impact review before apply.
D:For the workstream in which a database security group must be passed into a managed database resource without copying IDs into hardcoded variables, use this action: Reference the security group resource attribute directly from the database argument. Cross-resource references connect outputs to inputs and usually create implicit dependencies. Verify: Terraform's graph records the dependency and plans the database with the correct group identifier. Limitation: An attribute may be unknown until apply, but Terraform can still preserve the dependency graph.
E:For the workstream in which a team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation, use this action: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. State migration preserves the mapping between configuration addresses and existing objects. Verify: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. Limitation: Migration needs destination permissions, correct workspace identity, and validation of resulting state.
Incorrect Answers
B:This action is appropriate instead for a different, unlisted requirement: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. It would be checked by: A plan shows the bound object as no longer desired when its resource address disappears from configuration. 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: Two branches of a retailer deploy similar staging clusters, but each hand-built cluster gradually acquires different firewall rules. It would be checked by: Review version-control diffs and compare planned firewall changes for both environments. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
F:This action is appropriate instead for a different, unlisted requirement: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. It would be checked by: The plan identifies primary and recovery resources using the intended regional provider instances. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 211
An infrastructure team faces this specific situation: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. Which Terraform action most directly satisfies the requirement?
- Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported.
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
- Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
- Add a variable validation block with a clear condition and error message appropriate for the supported expression.
Explanation
Correct Answer
B:For this case, the appropriate action is: Index the resource collection by its actual for_each key rather than assuming numeric list positions. For_each resources are addressed using keys, whereas count resources use numeric indices. Confirm it by checking: The evaluated expression points to the correct keyed instance address in the plan. Boundary: Keys must exist and be stable; renaming a key may change addresses and induce replacement.
Incorrect Answers
A: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 module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant decision is: Index the resource collection by its actual for_each key rather than assuming numeric list positions. 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 decision is: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant decision is: Index the resource collection by its actual for_each key rather than assuming numeric list positions. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. There the relevant decision is: Add a variable validation block with a clear condition and error message appropriate for the supported expression. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant decision is: Index the resource collection by its actual for_each key rather than assuming numeric list positions. It would therefore not resolve or assess the case as stated.
Question 212
A reviewer is confirming a change for the following use case: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. The implementation follows this approach: Index the resource collection by its actual for_each key rather than assuming numeric list positions. Which observation or acceptance test most directly verifies the intended result?
- The plan selects the production hostname only when the condition evaluates true.
- A change to one hostname affects its keyed address instead of renumbering unrelated instances.
- Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.
- The evaluated expression points to the correct keyed instance address in the plan.
Explanation
Correct Answer
D:Acceptance evidence: The evaluated expression points to the correct keyed instance address in the plan. It validates the proposed action, index the resource collection by its actual for_each key rather than assuming numeric list positions, because for_each resources are addressed using keys, whereas count resources use numeric indices. Remaining limitation: Keys must exist and be stable; renaming a key may change addresses and induce replacement.
Incorrect Answers
A: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 acceptance is: The plan selects the production hostname only when the condition evaluates true. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant acceptance is: The evaluated expression points to the correct keyed instance address in the plan. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: An application team must create one DNS record per hostname from a stable set of known domain names. There the relevant acceptance is: A change to one hostname affects its keyed address instead of renumbering unrelated instances. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant acceptance is: The evaluated expression points to the correct keyed instance address in the plan. It would therefore not resolve or assess the case as stated.
C: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 module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant acceptance is: The evaluated expression points to the correct keyed instance address in the plan. It would therefore not resolve or assess the case as stated.
Question 213
Consider a proposed solution for this requirement: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. The team plans to do the following: Index the resource collection by its actual for_each key rather than assuming numeric list positions. Which limitation or operational caveat must remain in the review?
- A precondition only protects the invariant actually encoded in its expression.
- Keys must exist and be stable; renaming a key may change addresses and induce replacement.
- Removing or renaming a key can still destroy or replace that keyed resource instance.
- dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks.
Explanation
Correct Answer
B:The limitation is keys must exist and be stable; renaming a key may change addresses and induce replacement. The proposed change is index the resource collection by its actual for_each key rather than assuming numeric list positions. Validate it by checking the evaluated expression points to the correct keyed instance address in the plan. for_each resources are addressed using keys, whereas count resources use numeric indices.
Incorrect Answers
A: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 limitation is: A precondition only protects the invariant actually encoded in its expression. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant limitation is: Keys must exist and be stable; renaming a key may change addresses and induce replacement. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An application team must create one DNS record per hostname from a stable set of known domain names. There the relevant limitation is: Removing or renaming a key can still destroy or replace that keyed resource instance. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant limitation is: Keys must exist and be stable; renaming a key may change addresses and induce replacement. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant limitation is: dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant limitation is: Keys must exist and be stable; renaming a key may change addresses and induce replacement. It would therefore not resolve or assess the case as stated.
Question 214
The team is reviewing a Terraform implementation for this case: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Use a numeric count index for a for_each resource that is addressed by map keys.
- Treat an unrelated output value as though it automatically becomes a resource precondition.
- Use dynamic to create multiple top-level resource blocks directly inside one resource.
- Hardcode a stale image identifier while retaining a data source solely as decoration.
Explanation
Correct Answer
A:Reject the assumption: Use a numeric count index for a for_each resource that is addressed by map keys. Instead, index the resource collection by its actual for_each key rather than assuming numeric list positions. for_each resources are addressed using keys, whereas count resources use numeric indices. Acceptance evidence: The evaluated expression points to the correct keyed instance address in the plan.
Incorrect Answers
B: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 module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant misconception is: Use a numeric count index for a for_each resource that is addressed by map keys. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A security group requires multiple repeated ingress blocks derived from a variable collection, and copy-pasting blocks is error-prone. There the relevant misconception is: Use dynamic to create multiple top-level resource blocks directly inside one resource. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant misconception is: Use a numeric count index for a for_each resource that is addressed by map keys. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant misconception is: Hardcode a stale image identifier while retaining a data source solely as decoration. For the question's actual requirement — A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. — the specifically relevant misconception is: Use a numeric count index for a for_each resource that is addressed by map keys. It would therefore not resolve or assess the case as stated.
Question 215
A Terraform platform team is coordinating 2 independent decisions. Workstream A: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. and Workstream B: A private Git-sourced module has a reviewed release tag and an engineer adds version = "2.3" next to its Git source. Select exactly 2 actions, one addressing each distinct workstream.
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
- Choose an explicit Git ref in the source URL rather than the registry-specific module version argument.
- Use a supported HCP Terraform API-driven workflow and upload a configuration version to the intended workspace.
- Explain that Terraform compares current configuration with state bindings and plans to reconcile deleted declarations.
- Run terraform fmt -recursive on the intended directory tree after reviewing the file scope.
Explanation
Correct Answers
A:For the workstream in which a module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance, use this action: Index the resource collection by its actual for_each key rather than assuming numeric list positions. for_each resources are addressed using keys, whereas count resources use numeric indices. Verify: The evaluated expression points to the correct keyed instance address in the plan. Limitation: Keys must exist and be stable; renaming a key may change addresses and induce replacement.
B:For the workstream in which a private Git-sourced module has a reviewed release tag and an engineer adds version = "2.3" next to its Git source, use this action: Choose an explicit Git ref in the source URL rather than the registry-specific module version argument. VCS source selection is controlled by Git ref, whereas registry sources support module version constraints. Verify: Terraform downloads the module code at the intended Git tag or commit during init. Limitation: A moving branch ref does not provide the same immutability as a reviewed commit SHA.
Incorrect Answers
C:This option addresses a separate requirement: An automation tool needs to submit a Terraform plan without relying on a VCS webhook workflow. Evidence for that other requirement would be a controlled run is created from the uploaded configuration version with the right workspace inputs; neither listed workstream asks for it.
D:This option addresses a separate requirement: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. Evidence for that other requirement would be a plan shows the bound object as no longer desired when its resource address disappears from configuration; neither listed workstream asks for it.
E:This option addresses a separate requirement: A developer needs to format all Terraform files in nested module directories as part of a repository cleanup. Evidence for that other requirement would be the command rewrites formatting of Terraform configuration files in nested directories; neither listed workstream asks for it.
Question 216
An infrastructure team faces this specific situation: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. Which Terraform action most directly satisfies the requirement?
- Use a resource precondition whose condition can be evaluated before the relevant resource operation.
- Use for_each over a suitable set or map to create stable keyed resource instances.
- Expose the needed value through an output block in the child and reference module.child.output_name.
- Read or pass credentials with an approved Vault integration and secure runtime identity, applying ephemeral/write-only protections where supported.
Explanation
Correct Answer
C:Expose the needed value through an output block in the child and reference module.child.output_name. Module outputs deliberately publish selected results across scope boundaries. Verify: The root plan evaluates a public module output without reaching into private child locals. Limitation: A module output is an interface; it does not automatically expose every internal resource or local.
Incorrect Answers
A: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 decision is: Use a resource precondition whose condition can be evaluated before the relevant resource operation. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant decision is: Expose the needed value through an output block in the child and reference module.child.output_name. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: An application team must create one DNS record per hostname from a stable set of known domain names. There the relevant decision is: Use for_each over a suitable set or map to create stable keyed resource instances. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant decision is: Expose the needed value through an output block in the child and reference module.child.output_name. 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 resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant decision is: Expose the needed value through an output block in the child and reference module.child.output_name. It would therefore not resolve or assess the case as stated.
Question 217
A reviewer is confirming a change for the following use case: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. The implementation follows this approach: Expose the needed value through an output block in the child and reference module.child.output_name. Which observation or acceptance test most directly verifies the intended result?
- Subsequent plans avoid proposing updates solely because the ignored tag changed outside Terraform.
- The selected environment returns the class value under the requested map key.
- The dependency graph orders the attachment action before the dependent rule operation.
- The root plan evaluates a public module output without reaching into private child locals.
Explanation
Correct Answer
D:Acceptance evidence: The root plan evaluates a public module output without reaching into private child locals. It validates the proposed action, expose the needed value through an output block in the child and reference module.child.output_name, because module outputs deliberately publish selected results across scope boundaries. Remaining limitation: A module output is an interface; it does not automatically expose every internal resource or local.
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 resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant acceptance is: The root plan evaluates a public module output without reaching into private child locals. 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 acceptance is: The selected environment returns the class value under the requested map key. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant acceptance is: The root plan evaluates a public module output without reaching into private child locals. It would therefore not resolve or assess the case as stated.
C: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 acceptance is: The dependency graph orders the attachment action before the dependent rule operation. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant acceptance is: The root plan evaluates a public module output without reaching into private child locals. It would therefore not resolve or assess the case as stated.
Question 218
Consider a proposed solution for this requirement: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. The team plans to do the following: Expose the needed value through an output block in the child and reference module.child.output_name. Which limitation or operational caveat must remain in the review?
- A module output is an interface; it does not automatically expose every internal resource or local.
- An automatically changing latest-image lookup may propose later VM replacements depending on resource schema.
- Sets have no stable order and should not be indexed as though they were lists.
- Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe.
Explanation
Correct Answer
A:The limitation is a module output is an interface; it does not automatically expose every internal resource or local. The proposed change is expose the needed value through an output block in the child and reference module.child.output_name. Validate it by checking the root plan evaluates a public module output without reaching into private child locals. Module outputs deliberately publish selected results across scope boundaries.
Incorrect Answers
B:This is linked to a different situation: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. There the relevant limitation is: An automatically changing latest-image lookup may propose later VM replacements depending on resource schema. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant limitation is: A module output is an interface; it does not automatically expose every internal resource or local. It would therefore not resolve or assess the case as stated.
C: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 limitation is: Sets have no stable order and should not be indexed as though they were lists. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant limitation is: A module output is an interface; it does not automatically expose every internal resource or local. 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 limitation is: Only explicitly write-only provider arguments qualify; an arbitrary normal password argument is not automatically safe. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant limitation is: A module output is an interface; it does not automatically expose every internal resource or local. It would therefore not resolve or assess the case as stated.
Question 219
The team is reviewing a Terraform implementation for this case: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Use terraform fmt as a substitute for runtime result invariants on managed objects.
- Assume local values declared inside a child are globally accessible by the root module.
- Assume any object named in a data block is subject to resource deletion on destroy.
- Disable state refresh entirely as the permanent way to share control of a single attribute.
Explanation
Correct Answer
B:Reject the assumption: Assume local values declared inside a child are globally accessible by the root module. Instead, expose the needed value through an output block in the child and reference module.child.output_name. Module outputs deliberately publish selected results across scope boundaries. Acceptance evidence: The root plan evaluates a public module output without reaching into private child locals.
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 misconception is: Use terraform fmt as a substitute for runtime result invariants on managed objects. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant misconception is: Assume local values declared inside a child are globally accessible by the root module. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An engineer sees a data block representing a preexisting DNS zone and wants to delete that DNS zone with terraform destroy. There the relevant misconception is: Assume any object named in a data block is subject to resource deletion on destroy. For the question's actual requirement — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant misconception is: Assume local values declared inside a child are globally accessible by the root module. 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 — A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. — the specifically relevant misconception is: Assume local values declared inside a child are globally accessible by the root module. It would therefore not resolve or assess the case as stated.
Question 220
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly. and Workstream B: A developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply. and Workstream C: 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. Select exactly 3 actions, one addressing each distinct workstream.
- Run terraform fmt -recursive on the intended directory tree after reviewing the file scope.
- Configure separate HCP workspaces with correct working directories and path-based VCS run triggers.
- Expect the default local backend to manage a terraform.tfstate file in the working directory.
- Review the intended registry release and run terraform init -upgrade after updating constraints as needed.
- Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying.
- Expose the needed value through an output block in the child and reference module.child.output_name.
Explanation
Correct Answers
C:For the workstream in which a developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply, use this action: Expect the default local backend to manage a terraform.tfstate file in the working directory. Without an alternate backend or cloud integration, Terraform defaults to local state storage. Verify: A successful local apply creates or updates a locally persisted state snapshot for the selected workspace. Limitation: State can contain sensitive values and should be protected against accidental exposure or competing writers.
E:For the workstream in which 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, use this action: Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying. IaC represents desired resources in reviewable code, making configuration changes explicit rather than relying on a person's console memory. Verify: A fresh environment can be planned from the same versioned configuration and its intended change set reviewed. Limitation: Provider APIs and credentials are still required; merely storing HCL does not make the environment provision itself.
F:For the workstream in which a resource argument refers to an output produced by a child module, but the author attempts to read the child's internal local name directly, use this action: Expose the needed value through an output block in the child and reference module.child.output_name. Module outputs deliberately publish selected results across scope boundaries. Verify: The root plan evaluates a public module output without reaching into private child locals. Limitation: A module output is an interface; it does not automatically expose every internal resource or local.
Incorrect Answers
A: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.
B:This action is appropriate instead for a different, unlisted requirement: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. It would be checked by: Changing one directory triggers its intended workspace without spurious unrelated runs. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
D:This action is appropriate instead for a different, unlisted requirement: A registry module release contains an urgent fix and the team's installed module is still the previous compatible release. It would be checked by: The initialized module source matches the new permitted version and the resulting plan is reviewed. 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