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 58

Question 570

A Terraform platform team is coordinating 3 independent decisions. Workstream A: An organization has dozens of workspaces for finance and research teams with distinct access requirements. and Workstream B: A disposable integration environment must be removed without unintentionally deleting shared infrastructure in another state. and Workstream C: An infrastructure module is checked out from a private Git repository at a reviewed branch or tag, not published as a registry module. Select exactly 3 actions, one addressing each distinct workstream.

  1. Use a resource precondition whose condition can be evaluated before the relevant resource operation.
  2. Select the correct workspace/backend state and run terraform destroy only after reviewing its destruction plan.
  3. Declare configuration_aliases in the child and pass the intended configurations through module.providers.
  4. Use terraform show -json on the state or saved plan with proper access controls.
  5. Organize related workspaces into HCP Terraform projects and assign team-level project permissions.
  6. Use a valid git:: module source and an appropriate immutable reviewed ref, with the necessary credentials.

Explanation

Correct Answers

B:

For the workstream in which a disposable integration environment must be removed without unintentionally deleting shared infrastructure in another state, use this action: Select the correct workspace/backend state and run terraform destroy only after reviewing its destruction plan. Destroy targets resources Terraform manages in the selected state. Verify: The destruction plan lists the managed objects targeted in that state, not arbitrary cloud resources. Limitation: Provider dependencies and shared infrastructure still require a risk review before deletion.

E:

For the workstream in which an organization has dozens of workspaces for finance and research teams with distinct access requirements, use this action: Organize related workspaces into HCP Terraform projects and assign team-level project permissions. Projects group workspaces and provide a useful boundary for access policy. Verify: The intended finance and research teams have scoped access to their respective project workspaces. Limitation: A team may receive broader organization grants; confirm effective permissions after assigning project roles.

F:

For the workstream in which an infrastructure module is checked out from a private Git repository at a reviewed branch or tag, not published as a registry module, use this action: Use a valid git:: module source and an appropriate immutable reviewed ref, with the necessary credentials. Terraform can fetch VCS modules by source address and Git ref, but source type controls version selection. Verify: Initialization checks out the intended Git module revision and the plan uses its configuration. Limitation: Git source refs and the registry module version argument are different mechanisms.

Incorrect Answers

A:

This action is appropriate instead for a different, unlisted requirement: A team must verify a network policy's expected input range before taking an action that would violate the rule. It would be checked by: An invalid condition causes a diagnostic and blocks the governed action. 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 child network module expects two AWS provider aliases, but the root module has only passed its default provider. It would be checked by: The child resource plans with the specifically mapped source and destination provider aliases. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

D:

This action is appropriate instead for a different, unlisted requirement: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. It would be checked by: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 571

An infrastructure team faces this specific situation: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. Which Terraform action most directly satisfies the requirement?

  1. Configure a valid cloud block for the organization/workspace and authenticate with terraform login.
  2. Back up state, configure HCP cloud integration, and follow the prompted state migration during initialization.
  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

D:

Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Variable sets centralize shared configuration at project or organization scope. Verify: New and existing workspaces in the project receive the intended shared variable. Limitation: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins.

Incorrect Answers

A:

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 platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant decision is: Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. It would therefore not resolve or assess the case as stated.

B:

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

Question 572

A reviewer is confirming a change for the following use case: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. The implementation follows this approach: Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Which observation or acceptance test most directly verifies the intended result?

  1. New and existing workspaces in the project receive the intended shared variable.
  2. A relevant commit produces a workspace run and pull requests can show speculative plans if configured.
  3. The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources.
  4. A controlled run is created from the uploaded configuration version with the right workspace inputs.

Explanation

Correct Answer

A:

Acceptance evidence: New and existing workspaces in the project receive the intended shared variable. It validates the proposed action, create an appropriately scoped HCP Terraform variable set applied to those project workspaces, because variable sets centralize shared configuration at project or organization scope. Remaining limitation: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins.

Incorrect Answers

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 platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant acceptance is: New and existing workspaces in the project receive the intended shared variable. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. There the relevant acceptance is: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. For the question's actual requirement — A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant acceptance is: New and existing workspaces in the project receive the intended shared variable. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: An automation tool needs to submit a Terraform plan without relying on a VCS webhook workflow. There the relevant acceptance is: A controlled run is created from the uploaded configuration version with the right workspace inputs. For the question's actual requirement — A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant acceptance is: New and existing workspaces in the project receive the intended shared variable. It would therefore not resolve or assess the case as stated.

Question 573

Consider a proposed solution for this requirement: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. The team plans to do the following: Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Which limitation or operational caveat must remain in the review?

  1. Policy scope, policy language, and override semantics must be understood for the organization.
  2. Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins.
  3. CLI tokens are sensitive and workspace permissions still control access to plan and apply.
  4. Advisory is not the right choice for mandatory production enforcement requirements.

Explanation

Correct Answer

B:

The limitation is conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins. The proposed change is create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Validate it by checking new and existing workspaces in the project receive the intended shared variable. Variable sets centralize shared configuration at project or organization scope.

Incorrect Answers

A:

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 limitation is: Policy scope, policy language, and override semantics must be understood for the organization. For the question's actual requirement — A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant limitation is: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control. There the relevant limitation is: CLI tokens are sensitive and workspace permissions still control access to plan and apply. For the question's actual requirement — A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant limitation is: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins. It would therefore not resolve or assess the case as stated.

D:

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 platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant limitation is: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins. It would therefore not resolve or assess the case as stated.

Question 574

The team is reviewing a Terraform implementation for this case: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Assume displaying a policy file in a repository automatically enforces it in all HCP workspaces.
  2. Use a variable set as a substitute for storing and versioning reusable module code.
  3. Copy the same variable manually into every workspace as the only supported sharing mechanism.
  4. Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration.

Explanation

Correct Answer

C:

Reject the assumption: Copy the same variable manually into every workspace as the only supported sharing mechanism. Instead, create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Variable sets centralize shared configuration at project or organization scope. Acceptance evidence: New and existing workspaces in the project receive the intended shared variable.

Incorrect Answers

A:

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 misconception is: Assume displaying a policy file in a repository automatically enforces it in all HCP workspaces. For the question's actual requirement — A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant misconception is: Copy the same variable manually into every workspace as the only supported sharing mechanism. It would therefore not resolve or assess the case as stated.

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 platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant misconception is: Copy the same variable manually into every workspace as the only supported sharing mechanism. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. There the relevant misconception is: Create an empty new HCP state and apply the old configuration immediately without reviewing imports or migration. For the question's actual requirement — A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. — the specifically relevant misconception is: Copy the same variable manually into every workspace as the only supported sharing mechanism. It would therefore not resolve or assess the case as stated.

Question 575

A Terraform platform team is coordinating 2 independent decisions. Workstream A: A platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. and Workstream B: A training team wants to preview removal of all managed sandbox objects but not execute the deletion yet. Select exactly 2 actions, one addressing each distinct workstream.

  1. Run terraform plan -destroy to inspect the destruction actions without applying them.
  2. Declare an output in the child module and reference module.app.database_hostname from the root.
  3. Back up the current state and use terraform init -migrate-state when moving to the newly configured backend.
  4. Create an appropriately scoped HCP Terraform variable set applied to those project workspaces.
  5. Use for_each on the module block and reference module.stack["test"].endpoint.

Explanation

Correct Answers

A:

For the workstream in which a training team wants to preview removal of all managed sandbox objects but not execute the deletion yet, use this action: Run terraform plan -destroy to inspect the destruction actions without applying them. Destroy mode in plan provides an inspectable preview for teardown. Verify: The output enumerates expected managed-object deletions and remains speculative. Limitation: The resulting preview may not capture externally managed objects or later drift.

D:

For the workstream in which a platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project, use this action: Create an appropriately scoped HCP Terraform variable set applied to those project workspaces. Variable sets centralize shared configuration at project or organization scope. Verify: New and existing workspaces in the project receive the intended shared variable. Limitation: Conflicting variable definitions obey precedence rules; scope alone does not guarantee a value wins.

Incorrect Answers

B:

This option addresses a separate requirement: A private application module computes a database hostname internally and a root output must expose it to the deployment pipeline. Evidence for that other requirement would be the root output reads the child's exported value after apply or when known; neither listed workstream asks for it.

C:

This option addresses a separate requirement: A migration changes a backend location but the team must preserve all existing state bindings. Evidence for that other requirement would be the destination backend reflects the prior managed resource addresses and lineage after migration; neither listed workstream asks for it.

E:

This option addresses a separate requirement: A module is instantiated for each environment in a map, and the root needs the output for the test environment. Evidence for that other requirement would be the keyed module instance exposes only the test environment's selected output; neither listed workstream asks for it.

Question 576

An infrastructure team faces this specific situation: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. Which Terraform action most directly satisfies the requirement?

  1. Create an HCP Terraform workspace and configure an appropriate remote execution workflow with secure credentials.
  2. Configure separate HCP workspaces with correct working directories and path-based VCS run triggers.
  3. Use an advisory policy enforcement setting on the learning workspaces and monitor the warnings.
  4. Attach an appropriate policy set to relevant HCP workspaces and configure an enforcement level that blocks noncompliant applies.

Explanation

Correct Answer

B:

Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. Workspace working directories and trigger filters align a monorepo with separate state domains. Verify: Changing one directory triggers its intended workspace without spurious unrelated runs. Limitation: Shared module edits may require additional trigger patterns to update all dependent workspaces.

Incorrect Answers

A:

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 decision is: Create an HCP Terraform workspace and configure an appropriate remote execution workflow with secure credentials. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant decision is: Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. 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 decision is: Use an advisory policy enforcement setting on the learning workspaces and monitor the warnings. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant decision is: Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. It would therefore not resolve or assess the case as stated.

D:

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 uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant decision is: Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. It would therefore not resolve or assess the case as stated.

Question 577

A reviewer is confirming a change for the following use case: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. The implementation follows this approach: Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. Which observation or acceptance test most directly verifies the intended result?

  1. Reviewers can inspect plans and run history while only authorized teams can approve applies.
  2. The CLI connects to the HCP workspace and follows its selected remote execution and state workflow.
  3. Changing one directory triggers its intended workspace without spurious unrelated runs.
  4. The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources.

Explanation

Correct Answer

C:

Acceptance evidence: Changing one directory triggers its intended workspace without spurious unrelated runs. It validates the proposed action, configure separate HCP workspaces with correct working directories and path-based VCS run triggers, because workspace working directories and trigger filters align a monorepo with separate state domains. Remaining limitation: Shared module edits may require additional trigger patterns to update all dependent workspaces.

Incorrect Answers

A:

This is linked to a different situation: A compliance team needs centralized access control so reviewers can view runs but only deployers can approve infrastructure changes. There the relevant acceptance is: Reviewers can inspect plans and run history while only authorized teams can approve applies. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant acceptance is: Changing one directory triggers its intended workspace without spurious unrelated runs. It would therefore not resolve or assess the case as stated.

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 acceptance is: The CLI connects to the HCP workspace and follows its selected remote execution and state workflow. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant acceptance is: Changing one directory triggers its intended workspace without spurious unrelated runs. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A team is migrating existing local state into HCP Terraform and wants to avoid accidental duplicate resource creation. There the relevant acceptance is: The HCP workspace contains the existing managed addresses after migration and normal plan does not re-create all resources. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant acceptance is: Changing one directory triggers its intended workspace without spurious unrelated runs. It would therefore not resolve or assess the case as stated.

Question 578

Consider a proposed solution for this requirement: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. The team plans to do the following: Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. Which limitation or operational caveat must remain in the review?

  1. The identity provider trust configuration and cloud permissions must be correctly scoped and tested.
  2. The working directory cannot combine cloud and backend blocks, and authentication remains required.
  3. Policy scope, policy language, and override semantics must be understood for the organization.
  4. Shared module edits may require additional trigger patterns to update all dependent workspaces.

Explanation

Correct Answer

D:

The limitation is shared module edits may require additional trigger patterns to update all dependent workspaces. The proposed change is configure separate HCP workspaces with correct working directories and path-based VCS run triggers. Validate it by checking changing one directory triggers its intended workspace without spurious unrelated runs. Workspace working directories and trigger filters align a monorepo with separate state domains.

Incorrect Answers

A:

This is linked to a different situation: A company wants credential access for runs to be short-lived rather than distributing long-lived cloud keys to every workspace. There the relevant limitation is: The identity provider trust configuration and cloud permissions must be correctly scoped and tested. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant limitation is: Shared module edits may require additional trigger patterns to update all dependent workspaces. It would therefore not resolve or assess the case as stated.

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 limitation is: The working directory cannot combine cloud and backend blocks, and authentication remains required. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant limitation is: Shared module edits may require additional trigger patterns to update all dependent workspaces. 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 limitation is: Policy scope, policy language, and override semantics must be understood for the organization. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant limitation is: Shared module edits may require additional trigger patterns to update all dependent workspaces. It would therefore not resolve or assess the case as stated.

Question 579

The team is reviewing a Terraform implementation for this case: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Put the user API token directly into source-controlled HCL as the required login mechanism.
  2. Assume an HCP workspace always has all cloud IAM rights merely because a run executes remotely.
  3. Set every workspace to run on any repository push and expect monorepo changes never create duplicate runs.
  4. Expect only VCS-initiated commits to be capable of launching HCP Terraform runs.

Explanation

Correct Answer

C:

Reject the assumption: Set every workspace to run on any repository push and expect monorepo changes never create duplicate runs. Instead, configure separate HCP workspaces with correct working directories and path-based VCS run triggers. Workspace working directories and trigger filters align a monorepo with separate state domains. Acceptance evidence: Changing one directory triggers its intended workspace without spurious unrelated runs.

Incorrect Answers

A:

This is linked to a different situation: A local Terraform root must be connected to a specific HCP Terraform workspace without storing an API token in version control. There the relevant misconception is: Put the user API token directly into source-controlled HCL as the required login mechanism. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant misconception is: Set every workspace to run on any repository push and expect monorepo changes never create duplicate runs. It would therefore not resolve or assess the case as stated.

B:

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

D:

This is linked to a different situation: An automation tool needs to submit a Terraform plan without relying on a VCS webhook workflow. There the relevant misconception is: Expect only VCS-initiated commits to be capable of launching HCP Terraform runs. For the question's actual requirement — A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. — the specifically relevant misconception is: Set every workspace to run on any repository push and expect monorepo changes never create duplicate runs. It would therefore not resolve or assess the case as stated.

Question 580

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. and Workstream B: A pull request has inconsistent indentation and alignment, but the team does not want to provision any resources. and Workstream C: A child module uses var.environment but the root module declares an environment variable of the same name and passes nothing. Select exactly 3 actions, one addressing each distinct workstream.

  1. Keep one authoritative managed address per remote object and refactor references accordingly.
  2. Let the state lock serialize operations and retry after the active writer finishes.
  3. Configure separate HCP workspaces with correct working directories and path-based VCS run triggers.
  4. Declare the input in the child and supply environment = var.environment in the root's module call.
  5. Run terraform fmt -check for CI verification and terraform fmt to rewrite HCL formatting when authorized.
  6. Move to an appropriate shared backend with concurrency controls so both plans use the same authoritative state.

Explanation

Correct Answers

C:

For the workstream in which a company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change, use this action: Configure separate HCP workspaces with correct working directories and path-based VCS run triggers. Workspace working directories and trigger filters align a monorepo with separate state domains. Verify: Changing one directory triggers its intended workspace without spurious unrelated runs. Limitation: Shared module edits may require additional trigger patterns to update all dependent workspaces.

D:

For the workstream in which a child module uses var.environment but the root module declares an environment variable of the same name and passes nothing, use this action: Declare the input in the child and supply environment = var.environment in the root's module call. Explicit variable arguments make the child module interface predictable. Verify: Planning resolves the child's environment value from the explicit module call. Limitation: Input variables are scoped to each module and do not implicitly leak across module boundaries.

E:

For the workstream in which a pull request has inconsistent indentation and alignment, but the team does not want to provision any resources, use this action: Run terraform fmt -check for CI verification and terraform fmt to rewrite HCL formatting when authorized. The formatter normalizes the textual style of HCL rather than infrastructure state. Verify: The formatting check succeeds on canonical HCL layout without cloud API changes. Limitation: Formatting neither fixes a missing provider argument nor verifies runtime behavior.

Incorrect Answers

A:

This action is appropriate instead for a different, unlisted requirement: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. It would be checked by: State inspection shows the imported instance at a single intended address. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

B:

This action is appropriate instead for a different, unlisted requirement: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. It would be checked by: Only one run modifies the protected state at a time and the second safely waits or fails. 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: Two engineers share one project but each stores a different local state file and independently sees new resources in their plans. It would be checked by: Both operators observe the same resource addresses and coordinated state updates. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

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.