HashiCorp Terraform Associate 004 Exam Dumps, Practice Test Questions

100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

HashiCorp Terraform Associate 004 Premium Bundle
$64.98
$54.98

Terraform Associate 004 Premium Bundle

  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

Terraform Associate 004 Premium Bundle

HashiCorp Terraform Associate 004 Premium Bundle
  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$64.98
$54.98

HashiCorp Terraform Associate 004 Practice Test 60

Question 590

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control. and Workstream B: A newly created project uses both a Kubernetes cluster and cloud DNS records, and the same release should manage them coherently. and Workstream C: Two module instances share the same source but have different input maps, and an engineer expects identical endpoint addresses. Select exactly 3 actions, one addressing each distinct workstream.

  1. Treat each module call as a distinct instance with its own passed inputs and resource addresses.
  2. Declare separate supported Kubernetes and DNS providers and use their respective resource types in the same root module.
  3. Protect state storage and consider ephemeral flow or provider-supported write-only arguments where appropriate, not sensitive alone.
  4. Select the correct workspace/backend state and run terraform destroy only after reviewing its destruction plan.
  5. Back up the current state and use terraform init -migrate-state when moving to the newly configured backend.
  6. Use the cloud integration block for workspace mapping and authenticate with terraform login securely.

Explanation

Correct Answers

A:

For the workstream in which two module instances share the same source but have different input maps, and an engineer expects identical endpoint addresses, use this action: Treat each module call as a distinct instance with its own passed inputs and resource addresses. Each module call instantiates a distinct namespace for the same reusable configuration. Verify: The plan displays separate module.alpha and module.beta resource addresses with their respective values. Limitation: Reusing module source is code reuse, not infrastructure-instance reuse.

B:

For the workstream in which a newly created project uses both a Kubernetes cluster and cloud DNS records, and the same release should manage them coherently, use this action: Declare separate supported Kubernetes and DNS providers and use their respective resource types in the same root module. Terraform can orchestrate multiple service APIs by loading an appropriate provider for each distinct resource type. Verify: The plan shows objects from both provider schemas and does not misroute requests across APIs. Limitation: The existence of a provider does not prove its API endpoints or credentials are reachable in every environment.

F:

For the workstream in which a local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control, use this action: Use the cloud integration block for workspace mapping and authenticate with terraform login securely. HCP CLI integration separates workspace association and secure user authentication. Verify: CLI commands authenticate to the correct HCP organization/workspace and work with managed remote state. Limitation: CLI tokens are sensitive and workspace permissions still control access to plan and apply.

Incorrect Answers

C:

This action is appropriate instead for a different, unlisted requirement: An application secret is supplied as a Terraform variable marked sensitive, and a teammate claims it cannot enter a saved state file. It would be checked by: Inspect the chosen mechanism and verify secrets do not appear in plan/state artifacts where omission is required. 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 disposable integration environment must be removed without unintentionally deleting shared infrastructure in another state. It would be checked by: The destruction plan lists the managed objects targeted in that state, not arbitrary cloud resources. 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 migration changes a backend location but the team must preserve all existing state bindings. It would be checked by: The destination backend reflects the prior managed resource addresses and lineage after migration. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 591

An infrastructure team faces this specific situation: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. Which Terraform action most directly satisfies the requirement?

  1. Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization.
  2. Use suitable HCP Terraform workspace run triggers where supported to coordinate dependent runs.
  3. Publish and consume approved modules through an HCP Terraform private module registry with reviewed versions.
  4. Create an appropriately scoped HCP Terraform variable set applied to those project workspaces.

Explanation

Correct Answer

A:

Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. State migration preserves the mapping between configuration addresses and existing objects. Verify: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. Limitation: Migration needs destination permissions, correct workspace identity, and validation of resulting state.

Incorrect Answers

B:

This is linked to a different situation: A team needs one shared network workspace to finish before dependent application workspaces start their own updates. There the relevant decision is: Use suitable HCP Terraform workspace run triggers where supported to coordinate dependent runs. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant decision is: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An organization wants approved modules discoverable by many teams without copying source trees into every repo. There the relevant decision is: Publish and consume approved modules through an HCP Terraform private module registry with reviewed versions. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant decision is: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. There the relevant decision is: Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant decision is: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. It would therefore not resolve or assess the case as stated.

Question 592

A reviewer is confirming a change for the following use case: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. The implementation follows this approach: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. Which observation or acceptance test most directly verifies the intended result?

  1. Authorized workspaces resolve the approved private registry module during initialization.
  2. Violating plans produce visible advisory policy findings while runs remain allowed to continue.
  3. Plans and applies run under the HCP workspace and its state versions are centrally accessible to authorized users.
  4. The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources.

Explanation

Correct Answer

D:

Acceptance evidence: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. It validates the proposed action, back up state, configure HCP cloud integration, and follow the prompted state migration during initialization, because state migration preserves the mapping between configuration addresses and existing objects. Remaining limitation: Migration needs destination permissions, correct workspace identity, and validation of resulting state.

Incorrect Answers

A:

This is linked to a different situation: An organization wants approved modules discoverable by many teams without copying source trees into every repo. There the relevant acceptance is: Authorized workspaces resolve the approved private registry module during initialization. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant acceptance is: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A security team wants engineers to see policy violations without initially blocking learning-environment applies. There the relevant acceptance is: Violating plans produce visible advisory policy findings while runs remain allowed to continue. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant acceptance is: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A small team needs managed Terraform state and remotely executed infrastructure runs with shared visibility rather than running only from laptops. There the relevant acceptance is: Plans and applies run under the HCP workspace and its state versions are centrally accessible to authorized users. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant acceptance is: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. It would therefore not resolve or assess the case as stated.

Question 593

Consider a proposed solution for this requirement: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. The team plans to do the following: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. Which limitation or operational caveat must remain in the review?

  1. A team may receive broader organization grants; confirm effective permissions after assigning project roles.
  2. Run triggers coordinate workspace runs but do not automatically express every cross-workspace data dependency.
  3. Migration needs destination permissions, correct workspace identity, and validation of resulting state.
  4. The working directory cannot combine cloud and backend blocks, and authentication remains required.

Explanation

Correct Answer

C:

The limitation is migration needs destination permissions, correct workspace identity, and validation of resulting state. The proposed change is back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. Validate it by checking the HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. State migration preserves the mapping between configuration addresses and existing objects.

Incorrect Answers

A:

This is linked to a different situation: An organization has dozens of workspaces for finance and research teams with distinct access requirements. There the relevant limitation is: A team may receive broader organization grants; confirm effective permissions after assigning project roles. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant limitation is: Migration needs destination permissions, correct workspace identity, and validation of resulting state. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A team needs one shared network workspace to finish before dependent application workspaces start their own updates. There the relevant limitation is: Run triggers coordinate workspace runs but do not automatically express every cross-workspace data dependency. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant limitation is: Migration needs destination permissions, correct workspace identity, and validation of resulting state. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A workstation has Terraform CLI installed but a team wants the local CLI to invoke HCP Terraform remote runs and manage state. There the relevant limitation is: The working directory cannot combine cloud and backend blocks, and authentication remains required. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant limitation is: Migration needs destination permissions, correct workspace identity, and validation of resulting state. It would therefore not resolve or assess the case as stated.

Question 594

The team is reviewing a Terraform implementation for this case: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration.
  2. Use a variable set as a substitute for storing and versioning reusable module code.
  3. Assume two workspaces share one state file simply because a run trigger connects them.
  4. Assume a new HCP organization automatically imports and executes every local Terraform directory.

Explanation

Correct Answer

A:

Reject the assumption: Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration. Instead, back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. State migration preserves the mapping between configuration addresses and existing objects. Acceptance evidence: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources.

Incorrect Answers

B:

This is linked to a different situation: An organization wants approved modules discoverable by many teams without copying source trees into every repo. There the relevant misconception is: Use a variable set as a substitute for storing and versioning reusable module code. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant misconception is: Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A team needs one shared network workspace to finish before dependent application workspaces start their own updates. There the relevant misconception is: Assume two workspaces share one state file simply because a run trigger connects them. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant misconception is: Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A small team needs managed Terraform state and remotely executed infrastructure runs with shared visibility rather than running only from laptops. There the relevant misconception is: Assume a new HCP organization automatically imports and executes every local Terraform directory. For the question's actual requirement — A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. — the specifically relevant misconception is: Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration. It would therefore not resolve or assess the case as stated.

Question 595

A Terraform platform team is coordinating 2 independent decisions. Workstream A: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. and Workstream B: A root module contains a new variable validation rule, and an engineer wants to check the HCL before accessing cloud credentials. Select exactly 2 actions, one addressing each distinct workstream.

  1. Use a list(string) or tuple with explicit ordering semantics rather than a set.
  2. Index the resource collection by its actual for_each key rather than assuming numeric list positions.
  3. Use terraform validate for the initialized configuration, then separately test variable values during a plan.
  4. Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state.
  5. Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization.

Explanation

Correct Answers

C:

For the workstream in which a root module contains a new variable validation rule, and an engineer wants to check the HCL before accessing cloud credentials, use this action: Use terraform validate for the initialized configuration, then separately test variable values during a plan. Static correctness and input-specific conditions operate at different evaluation times. Verify: Static validation succeeds and an invalid supplied input is rejected at the stage where its custom condition is evaluated. Limitation: Some custom conditions depend on actual input or resource values and cannot all be exercised by validate alone.

E:

For the workstream in which a team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation, use this action: Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization. State migration preserves the mapping between configuration addresses and existing objects. Verify: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. Limitation: Migration needs destination permissions, correct workspace identity, and validation of resulting state.

Incorrect Answers

A:

This option addresses a separate requirement: A module emits an ordered list of three subnet IDs aligned with ordered availability zones and consumers depend on position. Evidence for that other requirement would be the first, second, and third output elements correspond to documented ordered subnet assignments; neither listed workstream asks for it.

B:

This option addresses a separate requirement: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. Evidence for that other requirement would be the evaluated expression points to the correct keyed instance address in the plan; neither listed workstream asks for it.

D:

This option addresses a separate requirement: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. Evidence for that other requirement would be the plan and state distinguish managed resource instances from unmanaged manual purchases; neither listed workstream asks for it.

Question 596

An infrastructure team faces this specific situation: A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. Which Terraform action most directly satisfies the requirement?

  1. Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles.
  2. Configure a valid cloud block for the organization/workspace and authenticate with terraform login.
  3. Attach an appropriate policy set to relevant HCP workspaces and configure an enforcement level that blocks noncompliant applies.
  4. Publish and consume approved modules through an HCP Terraform private module registry with reviewed versions.

Explanation

Correct Answer

A:

Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. Dynamic credentials use trust exchange to limit credential lifetime and distribution. Verify: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. Limitation: The identity provider trust configuration and cloud permissions must be correctly scoped and tested.

Incorrect Answers

B:

This is linked to a different situation: A workstation has Terraform CLI installed but a team wants the local CLI to invoke HCP Terraform remote runs and manage state. There the relevant decision is: Configure a valid cloud block for the organization/workspace and authenticate with terraform login. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant decision is: Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A governance team wants to prevent deployments of cloud resources that violate a mandatory tagging policy after plan evaluation. There the relevant decision is: Attach an appropriate policy set to relevant HCP workspaces and configure an enforcement level that blocks noncompliant applies. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant decision is: Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: An organization wants approved modules discoverable by many teams without copying source trees into every repo. There the relevant decision is: Publish and consume approved modules through an HCP Terraform private module registry with reviewed versions. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant decision is: Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. It would therefore not resolve or assess the case as stated.

Question 597

A reviewer is confirming a change for the following use case: A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. The implementation follows this approach: Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. Which observation or acceptance test most directly verifies the intended result?

  1. The intended finance and research teams have scoped access to their respective project workspaces.
  2. A relevant commit produces a workspace run and pull requests can show speculative plans if configured.
  3. New and existing workspaces in the project receive the intended shared variable.
  4. A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables.

Explanation

Correct Answer

D:

Acceptance evidence: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. It validates the proposed action, use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles, because dynamic credentials use trust exchange to limit credential lifetime and distribution. Remaining limitation: The identity provider trust configuration and cloud permissions must be correctly scoped and tested.

Incorrect Answers

A:

This is linked to a different situation: An organization has dozens of workspaces for finance and research teams with distinct access requirements. There the relevant acceptance is: The intended finance and research teams have scoped access to their respective project workspaces. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant acceptance is: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A development team connects one infrastructure repository to an HCP Terraform workspace and expects reviewed commits to trigger plans. There the relevant acceptance is: A relevant commit produces a workspace run and pull requests can show speculative plans if configured. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant acceptance is: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. There the relevant acceptance is: New and existing workspaces in the project receive the intended shared variable. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant acceptance is: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. It would therefore not resolve or assess the case as stated.

Question 598

Consider a proposed solution for this requirement: A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. The team plans to do the following: Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. Which limitation or operational caveat must remain in the review?

  1. In a monorepo, trigger paths should prevent unrelated folder changes from creating unnecessary runs.
  2. The identity provider trust configuration and cloud permissions must be correctly scoped and tested.
  3. Advisory is not the right choice for mandatory production enforcement requirements.
  4. Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins.

Explanation

Correct Answer

B:

The limitation is the identity provider trust configuration and cloud permissions must be correctly scoped and tested. The proposed change is use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. Validate it by checking a controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. Dynamic credentials use trust exchange to limit credential lifetime and distribution.

Incorrect Answers

A:

This is linked to a different situation: A development team connects one infrastructure repository to an HCP Terraform workspace and expects reviewed commits to trigger plans. There the relevant limitation is: In a monorepo, trigger paths should prevent unrelated folder changes from creating unnecessary runs. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant limitation is: The identity provider trust configuration and cloud permissions must be correctly scoped and tested. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A security team wants engineers to see policy violations without initially blocking learning-environment applies. There the relevant limitation is: Advisory is not the right choice for mandatory production enforcement requirements. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant limitation is: The identity provider trust configuration and cloud permissions must be correctly scoped and tested. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. There the relevant limitation is: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant limitation is: The identity provider trust configuration and cloud permissions must be correctly scoped and tested. It would therefore not resolve or assess the case as stated.

Question 599

The team is reviewing a Terraform implementation for this case: A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Copy the same variable manually into every workspace as the only supported sharing mechanism.
  2. Set every workspace to run on any repository push and expect monorepo changes never create duplicate runs.
  3. Assume an HCP workspace always has all cloud IAM rights merely because a run executes remotely.
  4. Assume terraform login alone attaches an arbitrary directory to a specific HCP workspace.

Explanation

Correct Answer

C:

Reject the assumption: Assume an HCP workspace always has all cloud IAM rights merely because a run executes remotely. Instead, use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. Dynamic credentials use trust exchange to limit credential lifetime and distribution. Acceptance evidence: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables.

Incorrect Answers

A:

This is linked to a different situation: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. There the relevant misconception is: Copy the same variable manually into every workspace as the only supported sharing mechanism. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant misconception is: Assume an HCP workspace always has all cloud IAM rights merely because a run executes remotely. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. There the relevant misconception is: Set every workspace to run on any repository push and expect monorepo changes never create duplicate runs. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant misconception is: Assume an HCP workspace always has all cloud IAM rights merely because a run executes remotely. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A workstation has Terraform CLI installed but a team wants the local CLI to invoke HCP Terraform remote runs and manage state. There the relevant misconception is: Assume terraform login alone attaches an arbitrary directory to a specific HCP workspace. For the question's actual requirement — A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. — the specifically relevant misconception is: Assume an HCP workspace always has all cloud IAM rights merely because a run executes remotely. It would therefore not resolve or assess the case as stated.

Question 600

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. and Workstream B: A web team must create a new load balancer and also look up an existing shared network ID managed by another team. and Workstream C: A deployment calls a reusable module with count = 3 and must reference the output of only the second instance. Select exactly 3 actions, one addressing each distinct workstream.

  1. Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup.
  2. Run terraform validate after successful initialization to check syntax and internal configuration consistency.
  3. Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles.
  4. Run terraform plan with normal refresh behavior and inspect drift-driven proposed updates.
  5. Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression.
  6. Disable or lower TF_LOG after collecting the targeted diagnostic evidence.

Explanation

Correct Answers

A:

For the workstream in which a web team must create a new load balancer and also look up an existing shared network ID managed by another team, use this action: Declare a managed resource for the new load balancer and an appropriate data source for the existing network lookup. Resource blocks manage lifecycle; data blocks query information without taking lifecycle ownership of the queried object. Verify: Plan distinguishes a create action from a read-only query of the existing network. Limitation: The data source requires access and will fail if its lookup criteria match no suitable object.

C:

For the workstream in which a company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace, use this action: Use a provider-supported HCP Terraform dynamic credentials integration with appropriately scoped cloud roles. Dynamic credentials use trust exchange to limit credential lifetime and distribution. Verify: A controlled run obtains temporary credentials and succeeds without storing static long-lived keys in workspace variables. Limitation: The identity provider trust configuration and cloud permissions must be correctly scoped and tested.

E:

For the workstream in which a deployment calls a reusable module with count = 3 and must reference the output of only the second instance, use this action: Refer to the indexed module instance, such as module.worker[1].endpoint, with an appropriate count expression. Counted module calls use numeric instance indices. Verify: The plan resolves the output for the intended counted module instance. Limitation: Changing count or order can affect addresses and cause unintended replacements.

Incorrect Answers

B:

This action is appropriate instead for a different, unlisted requirement: A developer adds a missing required argument to a resource definition and needs a fast validation before planning. It would be checked by: The validate command reports whether the configuration passes Terraform's static checks. 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 finance system's VPC has been manually changed outside Terraform and a release manager wants a preview of reconciliation. It would be checked by: The plan compares refreshed remote objects and current state against desired configuration. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

F:

This action is appropriate instead for a different, unlisted requirement: An operator leaves TF_LOG=TRACE enabled in production for all runs and sees excessive potentially sensitive logs. It would be checked by: Subsequent normal runs no longer emit verbose tracing to the same log destination. 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

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.