100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 240
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A child module expects a variable named subnet_ids, but the calling root references an undeclared variable from inside the child. and Workstream B: A Terraform job crashed and left a stale lock, but the team has not verified whether any other run is active. and Workstream C: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. Select exactly 3 actions, one addressing each distinct workstream.
- Use terraform state list to enumerate addresses in the selected state.
- Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.
- Declare the child's input variable and pass subnet_ids explicitly through its module block arguments.
- Keep one authoritative managed address per remote object and refactor references accordingly.
- Confirm there is no current state writer, then use force-unlock only for the team's own stale lock ID.
- Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
Explanation
Correct Answers
C:For the workstream in which a child module expects a variable named subnet_ids, but the calling root references an undeclared variable from inside the child, use this action: Declare the child's input variable and pass subnet_ids explicitly through its module block arguments. Modules receive inputs through explicit module-call arguments, keeping scopes understandable. Verify: The child's configuration validates and resolves the provided subnet IDs in its own scope. Limitation: Input variable declarations are module-scoped, not automatically shared across the entire configuration.
E:For the workstream in which a Terraform job crashed and left a stale lock, but the team has not verified whether any other run is active, use this action: Confirm there is no current state writer, then use force-unlock only for the team's own stale lock ID. Force-unlock is a recovery tool for stale locks, not a substitute for concurrency coordination. Verify: State operations resume without releasing a lock held by an active independent job. Limitation: Force unlocking a live operation can permit multiple writers and corrupt state.
F:For the workstream in which an operations group wants four engineers to propose a subnet change without all four immediately modifying production, use this action: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. The plan allows collaboration and review of proposed real-resource actions, which code diffs alone do not reveal. Verify: A pull request includes configuration differences and a plan describing expected resource mutations. Limitation: A plan is a snapshot of observed state and can become stale before apply.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. It would be checked by: The command outputs the expected resource instance addresses for further inspection. 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: 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.
D:This action is appropriate instead for a different, unlisted requirement: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. It would be checked by: State inspection shows the imported instance at a single intended address. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 241
An infrastructure team faces this specific situation: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. Which Terraform action most directly satisfies the requirement?
- Declare the child's input variable and pass subnet_ids explicitly through its module block arguments.
- Use an object type constraint within a map or list collection with named attribute types.
- Expose the needed value through an output block in the child and reference module.child.output_name.
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
Explanation
Correct Answer
B:Use an object type constraint within a map or list collection with named attribute types. Structured type constraints describe expected nested data and improve module interfaces. Verify: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. Limitation: An object type is not interchangeable with any arbitrary map if its declared attributes differ.
Incorrect Answers
A:This is linked to a different situation: A child module expects a variable named subnet_ids, but the calling root references an undeclared variable from inside the child. There the relevant decision is: Declare the child's input variable and pass subnet_ids explicitly through its module block arguments. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant decision is: Use an object type constraint within a map or list collection with named attribute types. It would therefore not resolve or assess the case as stated.
C:This is linked to a different 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. There the relevant decision is: Expose the needed value through an output block in the child and reference module.child.output_name. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant decision is: Use an object type constraint within a map or list collection with named attribute types. It would therefore not resolve or assess the case as stated.
D: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 — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant decision is: Use an object type constraint within a map or list collection with named attribute types. It would therefore not resolve or assess the case as stated.
Question 242
A reviewer is confirming a change for the following use case: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. The implementation follows this approach: Use an object type constraint within a map or list collection with named attribute types. Which observation or acceptance test most directly verifies the intended result?
- Plan distinguishes a create action from a read-only query of the existing network.
- The ephemeral value is supplied for the operation but omitted from saved state and plan data.
- Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors.
- The replacement plan creates the new instance before destroying the old one where provider constraints allow.
Explanation
Correct Answer
C:Acceptance evidence: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. It validates the proposed action, use an object type constraint within a map or list collection with named attribute types, because structured type constraints describe expected nested data and improve module interfaces. Remaining limitation: An object type is not interchangeable with any arbitrary map if its declared attributes differ.
Incorrect Answers
A:This is linked to a different situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. There the relevant acceptance is: Plan distinguishes a create action from a read-only query of the existing network. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant acceptance is: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. It would therefore not resolve or assess the case as stated.
B: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 acceptance is: The ephemeral value is supplied for the operation but omitted from saved state and plan data. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant acceptance is: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. 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 acceptance is: The replacement plan creates the new instance before destroying the old one where provider constraints allow. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant acceptance is: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. It would therefore not resolve or assess the case as stated.
Question 243
Consider a proposed solution for this requirement: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. The team plans to do the following: Use an object type constraint within a map or list collection with named attribute types. Which limitation or operational caveat must remain in the review?
- An object type is not interchangeable with any arbitrary map if its declared attributes differ.
- Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive.
- Converting a shared data lookup to a managed resource demands an ownership and import decision.
- Checks and preconditions have different failure effects, so choose based on governance needs.
Explanation
Correct Answer
A:The limitation is an object type is not interchangeable with any arbitrary map if its declared attributes differ. The proposed change is use an object type constraint within a map or list collection with named attribute types. Validate it by checking invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. Structured type constraints describe expected nested data and improve module interfaces.
Incorrect Answers
B: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 limitation is: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant limitation is: An object type is not interchangeable with any arbitrary map if its declared attributes differ. 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 limitation is: Converting a shared data lookup to a managed resource demands an ownership and import decision. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant limitation is: An object type is not interchangeable with any arbitrary map if its declared attributes differ. It would therefore not resolve or assess the case as stated.
D: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 limitation is: Checks and preconditions have different failure effects, so choose based on governance needs. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant limitation is: An object type is not interchangeable with any arbitrary map if its declared attributes differ. It would therefore not resolve or assess the case as stated.
Question 244
The team is reviewing a Terraform implementation for this case: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Assume a root variable of the same name is implicitly imported into all children.
- Use type string for the entire nested subnet inventory and rely on implicit parsing of every field.
- Use dynamic to create multiple top-level resource blocks directly inside one resource.
- Manually type an anticipated generated security group ID into a constant before creation.
Explanation
Correct Answer
B:Reject the assumption: Use type string for the entire nested subnet inventory and rely on implicit parsing of every field. Instead, use an object type constraint within a map or list collection with named attribute types. Structured type constraints describe expected nested data and improve module interfaces. Acceptance evidence: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors.
Incorrect Answers
A:This is linked to a different situation: A child module expects a variable named subnet_ids, but the calling root references an undeclared variable from inside the child. There the relevant misconception is: Assume a root variable of the same name is implicitly imported into all children. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant misconception is: Use type string for the entire nested subnet inventory and rely on implicit parsing of every field. 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 developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant misconception is: Use type string for the entire nested subnet inventory and rely on implicit parsing of every field. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A database security group must be passed into a managed database resource without copying IDs into hardcoded variables. There the relevant misconception is: Manually type an anticipated generated security group ID into a constant before creation. For the question's actual requirement — A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. — the specifically relevant misconception is: Use type string for the entire nested subnet inventory and rely on implicit parsing of every field. It would therefore not resolve or assess the case as stated.
Question 245
A Terraform platform team is coordinating 2 independent decisions. Workstream A: A developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking. and Workstream B: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. Select exactly 2 actions, one addressing each distinct workstream.
- Create an appropriately scoped HCP Terraform variable set applied to those project workspaces.
- Create a child module with declared input variables, resource blocks, and output values, then invoke it from a root module.
- Run terraform fmt -recursive on the intended directory tree after reviewing the file scope.
- Use an object type constraint within a map or list collection with named attribute types.
- Check the exact backend's current locking configuration and version-specific requirements before assuming locks work.
Explanation
Correct Answers
D:For the workstream in which a developer defines a subnet inventory in which every subnet has cidr, zone, and public attributes, and needs reliable shape checking, use this action: Use an object type constraint within a map or list collection with named attribute types. Structured type constraints describe expected nested data and improve module interfaces. Verify: Invalid records with wrong attribute types fail validation rather than causing obscure downstream errors. Limitation: An object type is not interchangeable with any arbitrary map if its declared attributes differ.
E:For the workstream in which an engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version, use this action: Check the exact backend's current locking configuration and version-specific requirements before assuming locks work. Backends vary in supported locking mechanisms and required configuration. Verify: A controlled test or backend documentation confirms a lock is obtained for state-mutating operations. Limitation: Storage location alone does not prove the required locking mechanism is configured or supported.
Incorrect Answers
A:This option addresses a separate requirement: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. Evidence for that other requirement would be new and existing workspaces in the project receive the intended shared variable; neither listed workstream asks for it.
B:This option addresses a separate requirement: A team is packaging a repeated VPC pattern and wants a stable interface for internal consumers. Evidence for that other requirement would be consumers can pass environment-specific inputs and receive selected outputs without editing child internals; neither listed workstream asks for it.
C: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 246
An infrastructure team faces this specific situation: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. Which Terraform action most directly satisfies the requirement?
- Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
- Consider lifecycle create_before_destroy on the managed resource after confirming simultaneous old and new instances are permitted.
- Choose an appropriate set(number) input type for distinct port values.
- Use for_each over a suitable set or map to create stable keyed resource instances.
Explanation
Correct Answer
C:Choose an appropriate set(number) input type for distinct port values. Set collections represent uniqueness and discard index-based ordering semantics. Verify: Repeated port values collapse to unique members without relying on list positions. Limitation: Sets have no stable order and should not be indexed as though they were lists.
Incorrect Answers
A:This is linked to a different situation: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. There the relevant decision is: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. For the question's actual requirement — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant decision is: Choose an appropriate set(number) input type for distinct port values. It would therefore not resolve or assess the case as stated.
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 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 — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant decision is: Choose an appropriate set(number) input type for distinct port values. It would therefore not resolve or assess the case as stated.
D: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 security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant decision is: Choose an appropriate set(number) input type for distinct port values. It would therefore not resolve or assess the case as stated.
Question 247
A reviewer is confirming a change for the following use case: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. The implementation follows this approach: Choose an appropriate set(number) input type for distinct port values. Which observation or acceptance test most directly verifies the intended result?
- Each input rule produces a corresponding nested ingress block in the planned resource.
- A failed check appears as a diagnostic rather than necessarily blocking the run like a precondition.
- Repeated port values collapse to unique members without relying on list positions.
- An invalid condition causes a diagnostic and blocks the governed action.
Explanation
Correct Answer
C:Acceptance evidence: Repeated port values collapse to unique members without relying on list positions. It validates the proposed action, choose an appropriate set(number) input type for distinct port values, because set collections represent uniqueness and discard index-based ordering semantics. Remaining limitation: Sets have no stable order and should not be indexed as though they were lists.
Incorrect Answers
A: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 acceptance is: Each input rule produces a corresponding nested ingress block in the planned resource. For the question's actual requirement — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant acceptance is: Repeated port values collapse to unique members without relying on list positions. It would therefore not resolve or assess the case as stated.
B: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 security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant acceptance is: Repeated port values collapse to unique members without relying on list positions. 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 acceptance is: An invalid condition causes a diagnostic and blocks the governed action. For the question's actual requirement — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant acceptance is: Repeated port values collapse to unique members without relying on list positions. It would therefore not resolve or assess the case as stated.
Question 248
Consider a proposed solution for this requirement: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. The team plans to do the following: Choose an appropriate set(number) input type for distinct port values. Which limitation or operational caveat must remain in the review?
- Explicit dependencies should be limited to real hidden dependencies; excessive depends_on can make plans conservative.
- An output does not create the referenced endpoint, and sensitive output values need safe handling.
- Sets have no stable order and should not be indexed as though they were lists.
- dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks.
Explanation
Correct Answer
C:The limitation is sets have no stable order and should not be indexed as though they were lists. The proposed change is choose an appropriate set(number) input type for distinct port values. Validate it by checking repeated port values collapse to unique members without relying on list positions. Set collections represent uniqueness and discard index-based ordering semantics.
Incorrect Answers
A: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 — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant limitation is: Sets have no stable order and should not be indexed as though they were lists. 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 limitation is: An output does not create the referenced endpoint, and sensitive output values need safe handling. For the question's actual requirement — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant limitation is: Sets have no stable order and should not be indexed as though they were lists. 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 security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant limitation is: Sets have no stable order and should not be indexed as though they were lists. It would therefore not resolve or assess the case as stated.
Question 249
The team is reviewing a Terraform implementation for this case: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts.
- Assume any object named in a data block is subject to resource deletion on destroy.
- Treat an unrelated output value as though it automatically becomes a resource precondition.
- Use a list and assume duplicate elements are automatically removed while maintaining indices.
Explanation
Correct Answer
D:Reject the assumption: Use a list and assume duplicate elements are automatically removed while maintaining indices. Instead, choose an appropriate set(number) input type for distinct port values. Set collections represent uniqueness and discard index-based ordering semantics. Acceptance evidence: Repeated port values collapse to unique members without relying on list positions.
Incorrect Answers
A: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 misconception is: Pass a password to an ordinary tracked resource attribute and expect Terraform to erase it from all artifacts. For the question's actual requirement — A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant misconception is: Use a list and assume duplicate elements are automatically removed while maintaining indices. It would therefore not resolve or assess the case as stated.
B: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 security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant misconception is: Use a list and assume duplicate elements are automatically removed while maintaining indices. It would therefore not resolve or assess the case as stated.
C: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 security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. — the specifically relevant misconception is: Use a list and assume duplicate elements are automatically removed while maintaining indices. It would therefore not resolve or assess the case as stated.
Question 250
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration. and Workstream B: A new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block. and Workstream C: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. Select exactly 3 actions, one addressing each distinct workstream.
- Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible.
- Declare one backend block inside terraform and reinitialize the working directory.
- Choose an appropriate set(number) input type for distinct port values.
- Use suitable HCP Terraform workspace run triggers where supported to coordinate dependent runs.
- Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying.
- Configure a valid cloud block for the organization/workspace and authenticate with terraform login.
Explanation
Correct Answers
A:For the workstream in which a team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers, use this action: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. The lock file preserves provider dependency selections within declared compatibility constraints. Verify: The chosen provider version and checksums are recorded in the lock file after initialization. Limitation: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.
B:For the workstream in which a new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block, use this action: Declare one backend block inside terraform and reinitialize the working directory. A terraform backend configuration controls state location independently of managed resource blocks. Verify: terraform init reports the selected backend and plan reads the correct shared state. Limitation: Backend arguments cannot reference ordinary input variables or data-source attributes.
C:For the workstream in which a security allowlist is an unordered set of unique ports and duplicate entries must not affect the configuration, use this action: Choose an appropriate set(number) input type for distinct port values. Set collections represent uniqueness and discard index-based ordering semantics. Verify: Repeated port values collapse to unique members without relying on list positions. Limitation: Sets have no stable order and should not be indexed as though they were lists.
Incorrect Answers
D:This action is appropriate instead for a different, unlisted requirement: A team needs one shared network workspace to finish before dependent application workspaces start their own updates. It would be checked by: A successful upstream application can queue the configured downstream workspace run. 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.
F:This action is appropriate instead for a different, unlisted requirement: A workstation has Terraform CLI installed but a team wants the local CLI to invoke HCP Terraform remote runs and manage state. It would be checked by: The CLI connects to the HCP workspace and follows its selected remote execution and state workflow. 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