WebMagicInformatica
Terraform Associate (004) practice questions

Terraform Associate (004) practice questions: HCP Terraform

5 free questions on HCP Terraform, 10% of the HashiCorp Terraform Associate exam. Try each one, then open the answer and explanation. None of them are in the free readiness check, so you can still take it fresh.

Question 1Choose 2

Which TWO capabilities does an HCP Terraform workspace provide for a team? (Choose two.)

  1. A.

    Automatic conversion of HCL to Python.

  2. B.

    A local terraform.tfstate file on each engineer's laptop.

  3. C.

    Remote state storage with state locking and version history.

  4. D.

    Run history with plan and apply logs for the workspace.

  5. E.

    Free unlimited cloud resources.

Show answer and explanation

Answer: C and D

An HCP Terraform workspace holds state (with history and locking), variables, and a history of runs with their logs.

  • Automatic conversion of HCL to Python.: No such capability exists.
  • A local terraform.tfstate file on each engineer's laptop.: State is stored remotely.
  • Free unlimited cloud resources.: HCP Terraform manages infrastructure; the resources are billed by your provider.
Question 2

A security team wants every plan checked automatically against rules, such as 'no public S3 buckets', before it can be applied. Which HCP Terraform feature fits?

  1. A.

    Variable sets.

  2. B.

    Policy enforcement with Sentinel or OPA policy sets.

  3. C.

    The private registry.

  4. D.

    Workspace tags only.

Show answer and explanation

Answer: B

Policy as code runs after the plan and before the apply and can block runs that violate rules.

  • Variable sets.: They share variable values.
  • The private registry.: It hosts modules and providers.
  • Workspace tags only.: Tags organise workspaces and don't evaluate plans.
Question 3

What is the purpose of projects in HCP Terraform?

  1. A.

    To store the Terraform state files of the CLI workspaces.

  2. B.

    To group related workspaces so that you can manage access and settings (such as variable sets) for the group.

  3. C.

    To replace the need for a Terraform configuration.

  4. D.

    To schedule cloud billing reports.

Show answer and explanation

Answer: B

Projects organise workspaces and let you assign team permissions and shared settings at the project level.

  • To store the Terraform state files of the CLI workspaces.: CLI workspaces use the configured backend.
  • To replace the need for a Terraform configuration.: Projects don't contain infrastructure definitions.
  • To schedule cloud billing reports.: They are not billing tools.
Question 4

A workspace is set to local execution mode instead of remote execution. What is the difference?

  1. A.

    Plans are never executed.

  2. B.

    State is stored on your local disk.

  3. C.

    The plan and apply run on your own machine or runner, while HCP Terraform only stores the state.

  4. D.

    Policies are enforced more strictly in local mode.

Show answer and explanation

Answer: C

In local execution mode Terraform runs locally and HCP Terraform acts as the state backend. In remote mode, runs happen on HCP Terraform infrastructure (or agents).

  • Plans are never executed.: Plans still run locally.
  • State is stored on your local disk.: State is still stored in HCP Terraform.
  • Policies are enforced more strictly in local mode.: Policy checks need remote runs.
Question 5Choose 2

Which TWO actions can start a run in an HCP Terraform workspace? (Choose two.)

  1. A.

    Pushing a commit to the connected VCS branch.

  2. B.

    Calling the HCP Terraform API to create a run.

  3. C.

    Editing the .terraform.lock.hcl file locally without pushing.

  4. D.

    Running terraform fmt on a laptop.

  5. E.

    Opening the Terraform Registry page of a module.

Show answer and explanation

Answer: A and B

Runs can start from VCS events, the UI, the CLI or the API.

  • Editing the .terraform.lock.hcl file locally without pushing.: Local file edits don't trigger remote runs.
  • Running terraform fmt on a laptop.: Formatting doesn't start runs.
  • Opening the Terraform Registry page of a module.: Browsing the registry doesn't start runs.

How ready are you for Terraform Associate (004)?

Take the free readiness check: 15 questions from every exam domain in 20 minutes, with your score per domain.

  • 20 minutes
  • 15 questions
  • Free with an account

More Terraform Associate (004) practice by topic

Back to the Terraform Associate (004) practice test →

Independent practice material written from the official exam guide. Not affiliated with or endorsed by the exam provider.