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 52

Question 510

A Terraform platform team is coordinating 3 independent decisions. Workstream A: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. and Workstream B: A nightly job wants to detect unexpected pending Terraform changes but should not mutate production resources. and Workstream C: A team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed. Select exactly 3 actions, one addressing each distinct workstream.

  1. Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan.
  2. Use terraform show -json on the state or saved plan with proper access controls.
  3. Run a speculative terraform plan with the desired inputs and examine its proposed changes.
  4. Set provider = aws.secondary on that resource, referencing the aliased provider configuration.
  5. Create an appropriately scoped HCP Terraform variable set applied to those project workspaces.
  6. Reference the local path with source = "./modules/security" inside the module block.

Explanation

Correct Answers

A:

For the workstream in which a team's database must never be accidentally destroyed by a routine Terraform plan while its resource declaration remains managed, use this action: Set lifecycle prevent_destroy and verify the protection is exercised by a proposed destructive plan. prevent_destroy rejects destructive plans while its rule is present in managed configuration. Verify: A plan that would destroy the configured protected resource is rejected with an error. Limitation: Removing the entire resource block also removes this configuration-based guard; it is not permanent cloud-side deletion protection.

B:

For the workstream in which an engineer wants a machine-readable view of the current Terraform state while building an inventory report, use this action: Use terraform show -json on the state or saved plan with proper access controls. JSON inspection supports automation but does not remove security obligations around state data. Verify: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. Limitation: Machine-readable state and plans may expose sensitive values and should not be publicly stored.

C:

For the workstream in which a nightly job wants to detect unexpected pending Terraform changes but should not mutate production resources, use this action: Run a speculative terraform plan with the desired inputs and examine its proposed changes. Plan previews reconciliation; apply would perform changes. Verify: The command returns a plan showing resource actions without executing them. Limitation: A speculative plan can become stale and must not be mistaken for an approval to apply.

Incorrect Answers

D:

This action is appropriate instead for a different, unlisted requirement: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. It would be checked by: The planned resource address resolves through the secondary provider while unqualified resources use the default. 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 platform administrator must reuse one nonsecret provider configuration variable across multiple workspaces in the same HCP project. It would be checked by: New and existing workspaces in the project receive the intended shared variable. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

F:

This action is appropriate instead for a different, unlisted requirement: A security group module lives in the local modules/security directory of the same versioned repository. It would be checked by: Terraform reads the local child module without fetching it from a remote registry. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 511

An infrastructure team faces this specific situation: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. Which Terraform action most directly satisfies the requirement?

  1. Use terraform show -json on the state or saved plan with proper access controls.
  2. Write a matching resource declaration and use an import block or terraform import with the real object identifier.
  3. Use terraform state list to enumerate addresses in the selected state.
  4. Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely.

Explanation

Correct Answer

D:

Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. TF_LOG controls Terraform CLI logging verbosity. Verify: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. Limitation: Verbose logs can contain confidential values and should be handled as sensitive evidence.

Incorrect Answers

A:

This is linked to a different situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. There the relevant decision is: Use terraform show -json on the state or saved plan with proper access controls. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant decision is: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant decision is: Write a matching resource declaration and use an import block or terraform import with the real object identifier. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant decision is: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. There the relevant decision is: Use terraform state list to enumerate addresses in the selected state. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant decision is: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. It would therefore not resolve or assess the case as stated.

Question 512

A reviewer is confirming a change for the following use case: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. The implementation follows this approach: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. Which observation or acceptance test most directly verifies the intended result?

  1. The JSON structure can be parsed for relevant addresses and outputs by authorized tooling.
  2. The plan shows import actions and any additional changes needed to align desired configuration.
  3. Terraform emits relevant diagnostic details to stderr while the log setting is enabled.
  4. State inspection shows the imported instance at a single intended address.

Explanation

Correct Answer

C:

Acceptance evidence: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. It validates the proposed action, set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely, because tF_LOG controls Terraform CLI logging verbosity. Remaining limitation: Verbose logs can contain confidential values and should be handled as sensitive evidence.

Incorrect Answers

A:

This is linked to a different situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. There the relevant acceptance is: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant acceptance is: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant acceptance is: The plan shows import actions and any additional changes needed to align desired configuration. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant acceptance is: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant acceptance is: State inspection shows the imported instance at a single intended address. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant acceptance is: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. It would therefore not resolve or assess the case as stated.

Question 513

Consider a proposed solution for this requirement: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. The team plans to do the following: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. Which limitation or operational caveat must remain in the review?

  1. State list does not prove remote objects still exist or show every attribute's current value.
  2. Generated configuration still requires technical review and may include values unsuitable for production.
  3. Import establishes identity and may not generate all required configuration fields automatically.
  4. Verbose logs can contain confidential values and should be handled as sensitive evidence.

Explanation

Correct Answer

D:

The limitation is verbose logs can contain confidential values and should be handled as sensitive evidence. The proposed change is set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. Validate it by checking terraform emits relevant diagnostic details to stderr while the log setting is enabled. TF_LOG controls Terraform CLI logging verbosity.

Incorrect Answers

A:

This is linked to a different situation: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. There the relevant limitation is: State list does not prove remote objects still exist or show every attribute's current value. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant limitation is: Verbose logs can contain confidential values and should be handled as sensitive evidence. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant limitation is: Generated configuration still requires technical review and may include values unsuitable for production. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant limitation is: Verbose logs can contain confidential values and should be handled as sensitive evidence. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant limitation is: Import establishes identity and may not generate all required configuration fields automatically. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant limitation is: Verbose logs can contain confidential values and should be handled as sensitive evidence. It would therefore not resolve or assess the case as stated.

Question 514

The team is reviewing a Terraform implementation for this case: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Import one object into as many addresses as possible to increase availability.
  2. Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure.
  3. Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing.
  4. Use terraform fmt to display the list of currently managed resource addresses.

Explanation

Correct Answer

C:

Reject the assumption: Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing. Instead, set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. TF_LOG controls Terraform CLI logging verbosity. Acceptance evidence: Terraform emits relevant diagnostic details to stderr while the log setting is enabled.

Incorrect Answers

A:

This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant misconception is: Import one object into as many addresses as possible to increase availability. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant misconception is: Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. There the relevant misconception is: Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant misconception is: Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. There the relevant misconception is: Use terraform fmt to display the list of currently managed resource addresses. For the question's actual requirement — A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. — the specifically relevant misconception is: Set an unrelated TF_VAR value and expect it to turn on Terraform CLI tracing. It would therefore not resolve or assess the case as stated.

Question 515

A Terraform platform team is coordinating 2 independent decisions. Workstream A: A provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics. and Workstream B: A release pipeline needs to ensure the exact reviewed plan, not a newly calculated one, is executed after approval. Select exactly 2 actions, one addressing each distinct workstream.

  1. Declare an input variable with type number and an appropriate default, overriding it per environment when needed.
  2. Configure a valid cloud block for the organization/workspace and authenticate with terraform login.
  3. Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely.
  4. Save the reviewed plan with terraform plan -out=release.tfplan and apply that saved plan file.
  5. Publish and consume approved modules through an HCP Terraform private module registry with reviewed versions.

Explanation

Correct Answers

C:

For the workstream in which a provider operation fails with an opaque authentication error and an engineer needs temporary, more detailed Terraform diagnostics, use this action: Set an appropriate TF_LOG level for the troubleshooting session and reproduce the error safely. TF_LOG controls Terraform CLI logging verbosity. Verify: Terraform emits relevant diagnostic details to stderr while the log setting is enabled. Limitation: Verbose logs can contain confidential values and should be handled as sensitive evidence.

D:

For the workstream in which a release pipeline needs to ensure the exact reviewed plan, not a newly calculated one, is executed after approval, use this action: Save the reviewed plan with terraform plan -out=release.tfplan and apply that saved plan file. A saved plan ties later execution to what was actually reviewed. Verify: The apply consumes the named plan artifact and uses its previously selected actions and variable values. Limitation: Saved plans may contain sensitive data and can be rejected if the underlying state changed.

Incorrect Answers

A:

This option addresses a separate requirement: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. Evidence for that other requirement would be plans show environment-specific port values while preserving the declared type constraint; neither listed workstream asks for it.

B:

This option addresses a separate requirement: A workstation has Terraform CLI installed but a team wants the local CLI to invoke HCP Terraform remote runs and manage state. Evidence for that other requirement would be the CLI connects to the HCP workspace and follows its selected remote execution and state workflow; neither listed workstream asks for it.

E:

This option addresses a separate requirement: An organization wants approved modules discoverable by many teams without copying source trees into every repo. Evidence for that other requirement would be authorized workspaces resolve the approved private registry module during initialization; neither listed workstream asks for it.

Question 516

An infrastructure team faces this specific situation: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. Which Terraform action most directly satisfies the requirement?

  1. Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging.
  2. Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state.
  3. Keep one authoritative managed address per remote object and refactor references accordingly.
  4. Generate and review a plan for the import block, optionally using supported configuration generation where appropriate.

Explanation

Correct Answer

A:

Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Both a logging level and destination are needed for persistent debug output. Verify: The configured log file contains the expected Terraform diagnostics from the run. Limitation: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared.

Incorrect Answers

B:

This is linked to a different situation: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. There the relevant decision is: Use terraform state show ADDRESS or a carefully scoped terraform show output on the selected state. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant decision is: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. There the relevant decision is: Keep one authoritative managed address per remote object and refactor references accordingly. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant decision is: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant decision is: Generate and review a plan for the import block, optionally using supported configuration generation where appropriate. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant decision is: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. It would therefore not resolve or assess the case as stated.

Question 517

A reviewer is confirming a change for the following use case: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. The implementation follows this approach: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Which observation or acceptance test most directly verifies the intended result?

  1. The plan shows import actions and any additional changes needed to align desired configuration.
  2. The selected resource's stored attributes and address are visible for diagnosis.
  3. The JSON structure can be parsed for relevant addresses and outputs by authorized tooling.
  4. The configured log file contains the expected Terraform diagnostics from the run.

Explanation

Correct Answer

D:

Acceptance evidence: The configured log file contains the expected Terraform diagnostics from the run. It validates the proposed action, set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging, because both a logging level and destination are needed for persistent debug output. Remaining limitation: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared.

Incorrect Answers

A:

This is linked to a different situation: A new import block is committed for a resource whose configuration is incomplete and the team wants a review before apply. There the relevant acceptance is: The plan shows import actions and any additional changes needed to align desired configuration. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant acceptance is: The configured log file contains the expected Terraform diagnostics from the run. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. There the relevant acceptance is: The selected resource's stored attributes and address are visible for diagnosis. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant acceptance is: The configured log file contains the expected Terraform diagnostics from the run. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. There the relevant acceptance is: The JSON structure can be parsed for relevant addresses and outputs by authorized tooling. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant acceptance is: The configured log file contains the expected Terraform diagnostics from the run. It would therefore not resolve or assess the case as stated.

Question 518

Consider a proposed solution for this requirement: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. The team plans to do the following: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Which limitation or operational caveat must remain in the review?

  1. Machine-readable state and plans may expose sensitive values and should not be publicly stored.
  2. State output may contain secrets and may be stale relative to the latest remote settings.
  3. State list does not prove remote objects still exist or show every attribute's current value.
  4. TF_LOG_PATH alone does not enable logging, and logs must not be casually shared.

Explanation

Correct Answer

D:

The limitation is tF_LOG_PATH alone does not enable logging, and logs must not be casually shared. The proposed change is set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Validate it by checking the configured log file contains the expected Terraform diagnostics from the run. Both a logging level and destination are needed for persistent debug output.

Incorrect Answers

A:

This is linked to a different situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. There the relevant limitation is: Machine-readable state and plans may expose sensitive values and should not be publicly stored. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant limitation is: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. There the relevant limitation is: State output may contain secrets and may be stale relative to the latest remote settings. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant limitation is: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. There the relevant limitation is: State list does not prove remote objects still exist or show every attribute's current value. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant limitation is: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared. It would therefore not resolve or assess the case as stated.

Question 519

The team is reviewing a Terraform implementation for this case: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Declare the database in HCL and assume the next apply will adopt any same-named existing object.
  2. Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events.
  3. Assume terraform state show is a live provider API query that always bypasses stored state.
  4. Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure.

Explanation

Correct Answer

B:

Reject the assumption: Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events. Instead, set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Both a logging level and destination are needed for persistent debug output. Acceptance evidence: The configured log file contains the expected Terraform diagnostics from the run.

Incorrect Answers

A:

This is linked to a different situation: A database already exists outside Terraform but needs to become managed under an explicit new resource address. There the relevant misconception is: Declare the database in HCL and assume the next apply will adopt any same-named existing object. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant misconception is: Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An analyst needs to inspect one managed resource's recorded attributes and associated provider metadata during an incident. There the relevant misconception is: Assume terraform state show is a live provider API query that always bypasses stored state. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant misconception is: Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. There the relevant misconception is: Upload a complete terraform show -json result to a public dashboard without reviewing secret exposure. For the question's actual requirement — A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. — the specifically relevant misconception is: Set only TF_LOG_PATH and assume Terraform automatically starts writing full debug events. It would therefore not resolve or assess the case as stated.

Question 520

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation. and Workstream B: An engineer clones a Terraform repository and sees an error that provider plugins are not installed. and Workstream C: A reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family. Select exactly 3 actions, one addressing each distinct workstream.

  1. Configure separate HCP workspaces with correct working directories and path-based VCS run triggers.
  2. Use suitable HCP Terraform workspace run triggers where supported to coordinate dependent runs.
  3. Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging.
  4. Add a variable validation block with a clear condition and error message appropriate for the supported expression.
  5. Configure default and aliased AWS providers and assign the disaster-recovery resource to the alias.
  6. Run terraform init in the root module directory to initialize backend, modules, and providers.

Explanation

Correct Answers

C:

For the workstream in which a CI team wants to preserve Terraform debug output to a controlled file for a short-lived investigation, use this action: Set TF_LOG and TF_LOG_PATH together, collect the protected log, then disable verbose logging. Both a logging level and destination are needed for persistent debug output. Verify: The configured log file contains the expected Terraform diagnostics from the run. Limitation: TF_LOG_PATH alone does not enable logging, and logs must not be casually shared.

D:

For the workstream in which a reusable module needs to reject a user-provided CIDR that is outside a documented allowed address family, use this action: Add a variable validation block with a clear condition and error message appropriate for the supported expression. Variable conditions verify value requirements beyond primitive type checking. Verify: Planning with an invalid input produces a useful validation error before unwanted resource operations. Limitation: Custom validation must reflect the true policy; a syntactically valid condition may be overly broad or restrictive.

F:

For the workstream in which an engineer clones a Terraform repository and sees an error that provider plugins are not installed, use this action: Run terraform init in the root module directory to initialize backend, modules, and providers. Initialization prepares the workspace rather than applying infrastructure resources. Verify: The .terraform working data and dependency lock file reflect successful initialization. Limitation: Init does not create configured cloud infrastructure merely by installing plugins.

Incorrect Answers

A:

This action is appropriate instead for a different, unlisted requirement: A company uses one VCS monorepo for several independent Terraform root directories and wants each to run only when relevant files change. It would be checked by: Changing one directory triggers its intended workspace without spurious unrelated runs. 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: A team needs one shared network workspace to finish before dependent application workspaces start their own updates. It would be checked by: A successful upstream application can queue the configured downstream workspace run. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

E:

This action is appropriate instead for a different, unlisted requirement: An infrastructure release creates AWS resources in two regions, with a disaster-recovery instance explicitly assigned to the second region. It would be checked by: The plan identifies primary and recovery resources using the intended regional provider instances. 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.