100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
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.
Question 251
An infrastructure team faces this specific situation: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. Which Terraform action most directly satisfies the requirement?
- 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.
- Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone.
- Use a list(string) or tuple with explicit ordering semantics rather than a set.
Explanation
Correct Answer
D:Use a list(string) or tuple with explicit ordering semantics rather than a set. List and tuple values preserve positional meaning; sets do not. Verify: The first, second, and third output elements correspond to documented ordered subnet assignments. Limitation: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting.
Incorrect Answers
A: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 module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant decision is: Use a list(string) or tuple with explicit ordering semantics rather than a set. It would therefore not resolve or assess the case as stated.
B: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 module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant decision is: Use a list(string) or tuple with explicit ordering semantics rather than a set. 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 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 module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant decision is: Use a list(string) or tuple with explicit ordering semantics rather than a set. It would therefore not resolve or assess the case as stated.
Question 252
A reviewer is confirming a change for the following use case: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. The implementation follows this approach: Use a list(string) or tuple with explicit ordering semantics rather than a set. Which observation or acceptance test most directly verifies the intended result?
- The plan uses the expected values while the shared module source remains unchanged.
- The first, second, and third output elements correspond to documented ordered subnet assignments.
- Terraform's graph records the dependency and plans the database with the correct group identifier.
- Each input rule produces a corresponding nested ingress block in the planned resource.
Explanation
Correct Answer
B:Acceptance evidence: The first, second, and third output elements correspond to documented ordered subnet assignments. It validates the proposed action, use a list(string) or tuple with explicit ordering semantics rather than a set, because list and tuple values preserve positional meaning; sets do not. Remaining limitation: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting.
Incorrect Answers
A:This is linked to a different situation: A deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL. There the relevant acceptance is: The plan uses the expected values while the shared module source remains unchanged. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant acceptance is: The first, second, and third output elements correspond to documented ordered subnet assignments. It would therefore not resolve or assess the case as stated.
C: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 acceptance is: Terraform's graph records the dependency and plans the database with the correct group identifier. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant acceptance is: The first, second, and third output elements correspond to documented ordered subnet assignments. 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 acceptance is: Each input rule produces a corresponding nested ingress block in the planned resource. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant acceptance is: The first, second, and third output elements correspond to documented ordered subnet assignments. It would therefore not resolve or assess the case as stated.
Question 253
Consider a proposed solution for this requirement: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. The team plans to do the following: Use a list(string) or tuple with explicit ordering semantics rather than a set. Which limitation or operational caveat must remain in the review?
- Order-sensitive outputs should not be built from unordered map iteration without intentional sorting.
- Ephemeral values have context restrictions and cannot be inserted into arbitrary persistent expressions.
- Unique names, fixed addresses, quotas, and dependent resources may prevent this pattern from succeeding.
- Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly.
Explanation
Correct Answer
A:The limitation is order-sensitive outputs should not be built from unordered map iteration without intentional sorting. The proposed change is use a list(string) or tuple with explicit ordering semantics rather than a set. Validate it by checking the first, second, and third output elements correspond to documented ordered subnet assignments. List and tuple values preserve positional meaning; sets do not.
Incorrect Answers
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 limitation is: Ephemeral values have context restrictions and cannot be inserted into arbitrary persistent expressions. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant limitation is: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting. It would therefore not resolve or assess the case as stated.
C: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 limitation is: Unique names, fixed addresses, quotas, and dependent resources may prevent this pattern from succeeding. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant limitation is: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting. 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 limitation is: Ignore rules do not ignore the attribute at initial resource creation and can hide meaningful drift if used too broadly. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant limitation is: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting. It would therefore not resolve or assess the case as stated.
Question 254
The team is reviewing a Terraform implementation for this case: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Convert the ordered IDs to set(string) while expecting indices to stay stable.
- Declare a variable named endpoint and assume it automatically exports the created object's address.
- Treat a for expression as a command that modifies original remote resources in-place.
- Treat an unrelated output value as though it automatically becomes a resource precondition.
Explanation
Correct Answer
A:Reject the assumption: Convert the ordered IDs to set(string) while expecting indices to stay stable. Instead, use a list(string) or tuple with explicit ordering semantics rather than a set. List and tuple values preserve positional meaning; sets do not. Acceptance evidence: The first, second, and third output elements correspond to documented ordered subnet assignments.
Incorrect Answers
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 module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant misconception is: Convert the ordered IDs to set(string) while expecting indices to stay stable. It would therefore not resolve or assess the case as stated.
C: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 misconception is: Treat a for expression as a command that modifies original remote resources in-place. For the question's actual requirement — A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant misconception is: Convert the ordered IDs to set(string) while expecting indices to stay stable. 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 module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. — the specifically relevant misconception is: Convert the ordered IDs to set(string) while expecting indices to stay stable. It would therefore not resolve or assess the case as stated.
Question 255
A Terraform platform team is coordinating 2 independent decisions. Workstream A: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. and Workstream B: A security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files. Select exactly 2 actions, one addressing each distinct workstream.
- Use a list(string) or tuple with explicit ordering semantics rather than a set.
- Use supported environment-based backend credentials or identity rather than embedding credentials in backend configuration.
- Configure the workspace's VCS connection, working directory, and run triggers for the intended branch.
- Treat each module call as a distinct instance with its own passed inputs and resource addresses.
- Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization.
Explanation
Correct Answers
A:For the workstream in which a module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position, use this action: Use a list(string) or tuple with explicit ordering semantics rather than a set. List and tuple values preserve positional meaning; sets do not. Verify: The first, second, and third output elements correspond to documented ordered subnet assignments. Limitation: Order-sensitive outputs should not be built from unordered map iteration without intentional sorting.
B:For the workstream in which a security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files, use this action: Use supported environment-based backend credentials or identity rather than embedding credentials in backend configuration. State backends need their own secure authentication channel; configuration literals are not automatically secret-safe. Verify: Backend initialization succeeds without static access keys embedded in .terraform or saved plan artifacts. Limitation: Backend configuration data can be captured in local initialization metadata and plan files.
Incorrect Answers
C:This option addresses a separate requirement: A development team connects one infrastructure repository to an HCP Terraform workspace and expects reviewed commits to trigger plans. Evidence for that other requirement would be a relevant commit produces a workspace run and pull requests can show speculative plans if configured; neither listed workstream asks for it.
D:This option addresses a separate requirement: Two module instances share the same source but have different input maps, and an engineer expects identical endpoint addresses. Evidence for that other requirement would be the plan displays separate module.alpha and module.beta resource addresses with their respective values; neither listed workstream asks for it.
E:This option addresses a separate requirement: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. Evidence for that other requirement would be the HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources; neither listed workstream asks for it.
Question 256
An infrastructure team faces this specific situation: A configuration needs a map from environment names to individually selected instance classes, with each value a string. Which Terraform action most directly satisfies the requirement?
- Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
- Use an ephemeral input value in an allowed Terraform ephemeral context, such as a supported provider configuration.
- Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it.
- Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
Explanation
Correct Answer
A:Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Maps encode named associations rather than numeric sequence positions. Verify: The selected environment returns the class value under the requested map key. Limitation: A missing map key causes an expression error unless a default is explicitly handled.
Incorrect Answers
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 decision is: Use an ephemeral input value in an allowed Terraform ephemeral context, such as a supported provider configuration. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant decision is: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. 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 decision is: Use lifecycle ignore_changes for the specifically shared tag attribute after agreeing which system owns it. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant decision is: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. It would therefore not resolve or assess the case as stated.
D: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 configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant decision is: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. It would therefore not resolve or assess the case as stated.
Question 257
A reviewer is confirming a change for the following use case: A configuration needs a map from environment names to individually selected instance classes, with each value a string. The implementation follows this approach: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Which observation or acceptance test most directly verifies the intended result?
- Each input rule produces a corresponding nested ingress block in the planned resource.
- Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required.
- The selected environment returns the class value under the requested map key.
- A plan that would destroy the configured protected resource is rejected with an error.
Explanation
Correct Answer
C:Acceptance evidence: The selected environment returns the class value under the requested map key. It validates the proposed action, declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"], because maps encode named associations rather than numeric sequence positions. Remaining limitation: A missing map key causes an expression error unless a default is explicitly handled.
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 configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant acceptance is: The selected environment returns the class value under the requested map key. It would therefore not resolve or assess the case as stated.
B: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 acceptance is: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant acceptance is: The selected environment returns the class value under the requested map key. It would therefore not resolve or assess the case as stated.
D: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 acceptance is: A plan that would destroy the configured protected resource is rejected with an error. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant acceptance is: The selected environment returns the class value under the requested map key. It would therefore not resolve or assess the case as stated.
Question 258
Consider a proposed solution for this requirement: A configuration needs a map from environment names to individually selected instance classes, with each value a string. The team plans to do the following: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Which limitation or operational caveat must remain in the review?
- dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks.
- A missing map key causes an expression error unless a default is explicitly handled.
- A conventional Vault data source may still write returned secrets into state unless a safe mechanism is chosen.
- Keys must exist and be stable; renaming a key may change addresses and induce replacement.
Explanation
Correct Answer
B:The limitation is a missing map key causes an expression error unless a default is explicitly handled. The proposed change is declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Validate it by checking the selected environment returns the class value under the requested map key. Maps encode named associations rather than numeric sequence positions.
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 limitation is: dynamic can generate normal nested blocks, not arbitrary provider meta-arguments or resource blocks. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant limitation is: A missing map key causes an expression error unless a default is explicitly handled. It would therefore not resolve or assess the case as stated.
C: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 limitation is: A conventional Vault data source may still write returned secrets into state unless a safe mechanism is chosen. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant limitation is: A missing map key causes an expression error unless a default is explicitly handled. 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 limitation is: Keys must exist and be stable; renaming a key may change addresses and induce replacement. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant limitation is: A missing map key causes an expression error unless a default is explicitly handled. It would therefore not resolve or assess the case as stated.
Question 259
The team is reviewing a Terraform implementation for this case: A configuration needs a map from environment names to individually selected instance classes, with each value a string. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Disable state refresh entirely as the permanent way to share control of a single attribute.
- Declare list(string) then index it by the environment name as if it were a map.
- Use terraform fmt as a substitute for runtime result invariants on managed objects.
- Rewrite the variable block's default on every run as the required deployment interface.
Explanation
Correct Answer
B:Reject the assumption: Declare list(string) then index it by the environment name as if it were a map. Instead, declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Maps encode named associations rather than numeric sequence positions. Acceptance evidence: The selected environment returns the class value under the requested map key.
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 misconception is: Disable state refresh entirely as the permanent way to share control of a single attribute. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant misconception is: Declare list(string) then index it by the environment name as if it were a map. It would therefore not resolve or assess the case as stated.
C: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 configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant misconception is: Declare list(string) then index it by the environment name as if it were a map. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL. There the relevant misconception is: Rewrite the variable block's default on every run as the required deployment interface. For the question's actual requirement — A configuration needs a map from environment names to individually selected instance classes, with each value a string. — the specifically relevant misconception is: Declare list(string) then index it by the environment name as if it were a map. It would therefore not resolve or assess the case as stated.
Question 260
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A configuration needs a map from environment names to individually selected instance classes, with each value a string. and Workstream B: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. and Workstream C: A service module declares use of a third-party provider but two different namespaces publish plugins with the same local name. Select exactly 3 actions, one addressing each distinct workstream.
- Review the generated plan and approve the apply prompt only if the changes are intended.
- Specify the provider's full registry source address under terraform.required_providers.
- Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
- Initialize the working directory, inspect a plan, and only then perform an authorized apply.
- Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration.
- Declare aliases in the child required_providers and explicitly pass both in the parent module.providers mapping.
Explanation
Correct Answers
B:For the workstream in which a service module declares use of a third-party provider but two different namespaces publish plugins with the same local name, use this action: Specify the provider's full registry source address under terraform.required_providers. Source addresses disambiguate providers that share local names. Verify: The lock entry identifies the intended registry namespace, provider type, and selected version. Limitation: Provider local names in HCL do not by themselves prove the external publisher namespace.
C:For the workstream in which a configuration needs a map from environment names to individually selected instance classes, with each value a string, use this action: Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"]. Maps encode named associations rather than numeric sequence positions. Verify: The selected environment returns the class value under the requested map key. Limitation: A missing map key causes an expression error unless a default is explicitly handled.
E:For the workstream in which a Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution, use this action: Select the appropriate HCP Terraform cloud integration and remove the conflicting backend declaration. HCP Terraform cloud integration and an explicit backend block are mutually exclusive in one root configuration. Verify: Initialization uses the configured HCP organization and workspace association without a second backend block. Limitation: Migrating existing state to cloud-managed workspaces needs a controlled review and backup.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A developer executes terraform apply interactively without a plan file and sees a proposed change summary. It would be checked by: The apply command waits for confirmation before changing resources in normal interactive use. 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 newly hired engineer has a reviewed HCL repository but has not yet prepared its providers or backend. It would be checked by: The initialization succeeds and the reviewed plan enumerates proposed actions before change execution. 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 child module must receive two non-default provider aliases for cross-region VPN creation. It would be checked by: The child's plan uses the two exact provider instances rather than silently defaulting to one region. 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