100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 20
A Terraform platform team is coordinating 3 independent decisions. Workstream A: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. and Workstream B: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. and Workstream C: A registry module release contains an urgent fix and the team's installed module is still the previous compatible release. Select exactly 3 actions, one addressing each distinct workstream.
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
- Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization.
- Run a refresh-only plan, review its state changes, and apply refresh-only if the update is appropriate.
- Distinguish provider-version lock metadata from terraform.tfstate and protect the actual state through suitable backend controls.
- Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state.
- Review the intended registry release and run terraform init -upgrade after updating constraints as needed.
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.
E:For the workstream in which an audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure, use this action: Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state. Declarative configuration describes desired objects; state connects configuration addresses to real infrastructure instances. Verify: The plan and state distinguish managed resource instances from unmanaged manual purchases. Limitation: An IaC repository alone cannot retroactively adopt existing objects without an import or equivalent workflow.
F: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.
Incorrect Answers
B:This action is appropriate instead for a different, unlisted requirement: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. It would be checked by: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
C:This action is appropriate instead for a different, unlisted requirement: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. It would be checked by: State and root outputs synchronize with observed remote data without changing the cloud object itself. 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 team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. It would be checked by: Inspection shows the lock file describes plugin versions while state records resource attributes and bindings. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 21
An infrastructure team faces this specific situation: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. Which Terraform action most directly satisfies the requirement?
- Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
- Select suitable Azure and monitoring providers and declare both systems through one Terraform root module.
- Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state.
- Reuse one reviewed Terraform module with explicit environment inputs instead of independently editing each deployment.
Explanation
Correct Answer
A: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
B:This is linked to a different situation: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. There the relevant decision is: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant decision is: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. There the relevant decision is: Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant decision is: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: Two branches of a retailer deploy similar staging clusters, but each hand-built cluster gradually acquires different firewall rules. There the relevant decision is: Reuse one reviewed Terraform module with explicit environment inputs instead of independently editing each deployment. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant decision is: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. It would therefore not resolve or assess the case as stated.
Question 22
A reviewer is confirming a change for the following use case: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. The implementation follows this approach: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. Which observation or acceptance test most directly verifies the intended result?
- Plan output contains the cloud deployment and monitoring integrations with clear provider ownership.
- A single plan lists the intended private and public resource actions under their respective providers.
- A pull request includes configuration differences and a plan describing expected resource mutations.
- The plan and state distinguish managed resource instances from unmanaged manual purchases.
Explanation
Correct Answer
C:Acceptance evidence: A pull request includes configuration differences and a plan describing expected resource mutations. It validates the proposed action, review the HCL change through version control and inspect a Terraform execution plan before authorized apply, because the plan allows collaboration and review of proposed real-resource actions, which code diffs alone do not reveal. Remaining limitation: A plan is a snapshot of observed state and can become stale before apply.
Incorrect Answers
A:This is linked to a different situation: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. There the relevant acceptance is: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant acceptance is: A pull request includes configuration differences and a plan describing expected resource mutations. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A logistics firm needs a private data-center virtual machine and a public-cloud DNS record managed from one reviewed release. There the relevant acceptance is: A single plan lists the intended private and public resource actions under their respective providers. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant acceptance is: A pull request includes configuration differences and a plan describing expected resource mutations. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. There the relevant acceptance is: The plan and state distinguish managed resource instances from unmanaged manual purchases. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant acceptance is: A pull request includes configuration differences and a plan describing expected resource mutations. It would therefore not resolve or assess the case as stated.
Question 23
Consider a proposed solution for this requirement: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. The team plans to do the following: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. Which limitation or operational caveat must remain in the review?
- Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported.
- An IaC repository alone cannot retroactively adopt existing objects without an import or equivalent workflow.
- Each endpoint still needs its own supported provider, authentication, connectivity, and permissions.
- A plan is a snapshot of observed state and can become stale before apply.
Explanation
Correct Answer
D:The limitation is a plan is a snapshot of observed state and can become stale before apply. The proposed change is review the HCL change through version control and inspect a Terraform execution plan before authorized apply. Validate it by checking a pull request includes configuration differences and a plan describing expected resource mutations. The plan allows collaboration and review of proposed real-resource actions, which code diffs alone do not reveal.
Incorrect Answers
A:This is linked to a different situation: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. There the relevant limitation is: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant limitation is: A plan is a snapshot of observed state and can become stale before apply. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. There the relevant limitation is: An IaC repository alone cannot retroactively adopt existing objects without an import or equivalent workflow. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant limitation is: A plan is a snapshot of observed state and can become stale before apply. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A logistics firm needs a private data-center virtual machine and a public-cloud DNS record managed from one reviewed release. There the relevant limitation is: Each endpoint still needs its own supported provider, authentication, connectivity, and permissions. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant limitation is: A plan is a snapshot of observed state and can become stale before apply. It would therefore not resolve or assess the case as stated.
Question 24
The team is reviewing a Terraform implementation for this case: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Equate a clean git diff with proof that no remote resource changes will be planned.
- Assume naming a server in a text file automatically imports that already-existing server into state.
- Expect an Azure resource block to manage an unrelated SaaS API without that service's provider.
- Treat an undocumented click sequence as a reproducible declarative infrastructure definition.
Explanation
Correct Answer
A:Reject the assumption: Equate a clean git diff with proof that no remote resource changes will be planned. Instead, 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. Acceptance evidence: A pull request includes configuration differences and a plan describing expected resource mutations.
Incorrect Answers
B:This is linked to a different situation: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. There the relevant misconception is: Assume naming a server in a text file automatically imports that already-existing server into state. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant misconception is: Equate a clean git diff with proof that no remote resource changes will be planned. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. There the relevant misconception is: Expect an Azure resource block to manage an unrelated SaaS API without that service's provider. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant misconception is: Equate a clean git diff with proof that no remote resource changes will be planned. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: 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. There the relevant misconception is: Treat an undocumented click sequence as a reproducible declarative infrastructure definition. For the question's actual requirement — An operations group wants four engineers to propose a subnet change without all four immediately modifying production. — the specifically relevant misconception is: Equate a clean git diff with proof that no remote resource changes will be planned. It would therefore not resolve or assess the case as stated.
Question 25
A Terraform platform team is coordinating 2 independent decisions. Workstream A: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. and Workstream B: 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. Select exactly 2 actions, one addressing each distinct workstream.
- Use an advisory policy enforcement setting on the learning workspaces and monitor the warnings.
- Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
- Declare aliases in the child required_providers and explicitly pass both in the parent module.providers mapping.
- Expose the needed value through an output block in the child and reference module.child.output_name.
- Specify the provider's full registry source address under terraform.required_providers.
Explanation
Correct Answers
B: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.
D: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 option addresses a separate requirement: A security team wants engineers to see policy violations without initially blocking learning-environment applies. Evidence for that other requirement would be violating plans produce visible advisory policy findings while runs remain allowed to continue; neither listed workstream asks for it.
C:This option addresses a separate requirement: A child module must receive two non-default provider aliases for cross-region VPN creation. Evidence for that other requirement would be the child's plan uses the two exact provider instances rather than silently defaulting to one region; neither listed workstream asks for it.
E:This option addresses a separate requirement: A service module declares use of a third-party provider but two different namespaces publish plugins with the same local name. Evidence for that other requirement would be the lock entry identifies the intended registry namespace, provider type, and selected version; neither listed workstream asks for it.
Question 26
An infrastructure team faces this specific situation: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. Which Terraform action most directly satisfies the requirement?
- Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying.
- Reuse one reviewed Terraform module with explicit environment inputs instead of independently editing each deployment.
- Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
- Select suitable Azure and monitoring providers and declare both systems through one Terraform root module.
Explanation
Correct Answer
D:Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Providers translate Terraform's declarative configuration into service-specific resource operations. Verify: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. Limitation: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported.
Incorrect Answers
A:This is linked to a different situation: 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. There the relevant decision is: Describe the desired networks and dependencies in versioned Terraform configuration and review plans before applying. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant decision is: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: Two branches of a retailer deploy similar staging clusters, but each hand-built cluster gradually acquires different firewall rules. There the relevant decision is: Reuse one reviewed Terraform module with explicit environment inputs instead of independently editing each deployment. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant decision is: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. There the relevant decision is: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant decision is: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. It would therefore not resolve or assess the case as stated.
Question 27
A reviewer is confirming a change for the following use case: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. The implementation follows this approach: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Which observation or acceptance test most directly verifies the intended result?
- Plan output contains the cloud deployment and monitoring integrations with clear provider ownership.
- A fresh environment can be planned from the same versioned configuration and its intended change set reviewed.
- A pull request includes configuration differences and a plan describing expected resource mutations.
- The plan and state distinguish managed resource instances from unmanaged manual purchases.
Explanation
Correct Answer
A:Acceptance evidence: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. It validates the proposed action, select suitable Azure and monitoring providers and declare both systems through one Terraform root module, because providers translate Terraform's declarative configuration into service-specific resource operations. Remaining limitation: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported.
Incorrect Answers
B:This is linked to a different situation: 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. There the relevant acceptance is: A fresh environment can be planned from the same versioned configuration and its intended change set reviewed. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant acceptance is: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. There the relevant acceptance is: A pull request includes configuration differences and a plan describing expected resource mutations. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant acceptance is: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. There the relevant acceptance is: The plan and state distinguish managed resource instances from unmanaged manual purchases. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant acceptance is: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. It would therefore not resolve or assess the case as stated.
Question 28
Consider a proposed solution for this requirement: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. The team plans to do the following: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Which limitation or operational caveat must remain in the review?
- Shared code needs safe parameterization and review, or the same erroneous rule can propagate everywhere.
- A plan is a snapshot of observed state and can become stale before apply.
- Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported.
- Provider APIs and credentials are still required; merely storing HCL does not make the environment provision itself.
Explanation
Correct Answer
C:The limitation is terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported. The proposed change is select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Validate it by checking plan output contains the cloud deployment and monitoring integrations with clear provider ownership. Providers translate Terraform's declarative configuration into service-specific resource operations.
Incorrect Answers
A:This is linked to a different situation: Two branches of a retailer deploy similar staging clusters, but each hand-built cluster gradually acquires different firewall rules. There the relevant limitation is: Shared code needs safe parameterization and review, or the same erroneous rule can propagate everywhere. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant limitation is: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. There the relevant limitation is: A plan is a snapshot of observed state and can become stale before apply. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant limitation is: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: 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. There the relevant limitation is: Provider APIs and credentials are still required; merely storing HCL does not make the environment provision itself. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant limitation is: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported. It would therefore not resolve or assess the case as stated.
Question 29
The team is reviewing a Terraform implementation for this case: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Equate a clean git diff with proof that no remote resource changes will be planned.
- Expect an Azure resource block to manage an unrelated SaaS API without that service's provider.
- Treat an undocumented click sequence as a reproducible declarative infrastructure definition.
- Assume naming a server in a text file automatically imports that already-existing server into state.
Explanation
Correct Answer
B:Reject the assumption: Expect an Azure resource block to manage an unrelated SaaS API without that service's provider. Instead, select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Providers translate Terraform's declarative configuration into service-specific resource operations. Acceptance evidence: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership.
Incorrect Answers
A:This is linked to a different situation: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. There the relevant misconception is: Equate a clean git diff with proof that no remote resource changes will be planned. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant misconception is: Expect an Azure resource block to manage an unrelated SaaS API without that service's provider. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: 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. There the relevant misconception is: Treat an undocumented click sequence as a reproducible declarative infrastructure definition. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant misconception is: Expect an Azure resource block to manage an unrelated SaaS API without that service's provider. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. There the relevant misconception is: Assume naming a server in a text file automatically imports that already-existing server into state. For the question's actual requirement — A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. — the specifically relevant misconception is: Expect an Azure resource block to manage an unrelated SaaS API without that service's provider. It would therefore not resolve or assess the case as stated.
Question 30
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. and Workstream B: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. and Workstream C: A developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply. Select exactly 3 actions, one addressing each distinct workstream.
- Declare an input variable with type number and an appropriate default, overriding it per environment when needed.
- Inspect terraform plan -replace=ADDRESS and review any downstream dependencies before applying.
- Pass a different root provider configuration into each module call through its providers map.
- Use terraform state list to enumerate addresses in the selected state.
- Select suitable Azure and monitoring providers and declare both systems through one Terraform root module.
- Expect the default local backend to manage a terraform.tfstate file in the working directory.
Explanation
Correct Answers
A:For the workstream in which a deployment needs separate port numbers per environment and a documented default for developer sandboxes, use this action: Declare an input variable with type number and an appropriate default, overriding it per environment when needed. Input variables parameterize a module; outputs report values out of the module. Verify: Plans show environment-specific port values while preserving the declared type constraint. Limitation: Defaults should not embed production secrets or bypass review of production-specific values.
E:For the workstream in which a company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages, use this action: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Providers translate Terraform's declarative configuration into service-specific resource operations. Verify: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. Limitation: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported.
F: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.
Incorrect Answers
B:This action is appropriate instead for a different, unlisted requirement: A deployment operator needs to replace a single degraded instance deliberately while keeping its resource address. It would be checked by: The proposed plan marks that particular resource instance for replacement. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
C:This action is appropriate instead for a different, unlisted requirement: A security team calls the same reusable child module twice, once under each of two cloud accounts. It would be checked by: Each module instance is associated with the correct account provider during plan. 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 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.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests