Free practice test · no sign-up

Terraform AssociateFree HashiCorp Certified: Terraform Associate (004) practice test

  • ✓ 10 free questions
  • ✓ Instant answers & explanations
  • ✓ No sign-up, no email

10 real Terraform Associate practice questions with instant answers and explanations — no account, no credit card, no email. Score yourself, then unlock the full bank of 70 questions whenever you’re ready. The Terraform Associate passing score is Pass/fail (HashiCorp does not publish a cut score).

Question 1 of 10

Which block type reads information about infrastructure that Terraform does not itself create or manage?

Answer key

All 10 Terraform Associate questions & answers

Prefer to just read the answers and explanations? Here’s the full key for this free Terraform Associate test.

Q1. Which block type reads information about infrastructure that Terraform does not itself create or manage?

Correct answer: B. data

A data block (data source) queries and reads existing information, whereas a resource block creates and manages infrastructure objects.

Q2. You declare an input variable with no default and provide no value on the command line or in a tfvars file. During an interactive run, what does Terraform do?

Correct answer: B. Prompts you interactively to supply the value

When a variable has no default and no supplied value, Terraform prompts for it interactively rather than erroring or guessing.

Q3. What is the main effect of setting sensitive = true on an input variable?

Correct answer: B. It suppresses the value from plan and apply output in the CLI

The sensitive flag redacts a value from CLI output; it does not encrypt state, and sensitive values can still appear in state in plaintext.

Q4. What is the primary purpose of a locals block?

Correct answer: B. To name expressions so they can be reused within the same module

Local values assign a name to an expression for reuse inside a module; unlike variables they cannot be set from outside.

Q5. Which block exposes a computed value so it can be referenced by a parent module or displayed after apply?

Correct answer: C. output

Output blocks publish values from a module for use by callers and for display after apply.

Q6. You must create many resources from a map, and each instance's identity should stay tied to its map key even when items are added or removed. Which meta-argument fits best?

Correct answer: B. for_each

for_each keys each instance by its map key or set value, so identities remain stable, unlike count which uses a positional index.

Q7. How does Terraform most commonly infer an implicit dependency between two resources?

Correct answer: B. When one resource references an attribute of the other

Referencing another resource's attribute establishes an implicit ordering edge in Terraform's dependency graph.

Q8. When is depends_on the appropriate tool to use?

Correct answer: B. When a dependency exists that cannot be expressed through an attribute reference

depends_on declares hidden dependencies that are not visible to Terraform through normal attribute references.

Q9. Which lifecycle argument causes Terraform to reject any plan that would destroy the resource?

Correct answer: C. prevent_destroy

prevent_destroy makes Terraform error on any plan that would delete the resource, guarding critical infrastructure.

Q10. An external system keeps changing a tag on a resource after creation, and you want Terraform to stop reverting it on every apply. Which setting achieves this?

Correct answer: B. ignore_changes for that attribute

Listing the attribute under lifecycle ignore_changes tells Terraform to ignore external drift on that attribute.

Exam facts and objectives sourced from the official HashiCorp certification page. Last reviewed June 2026.

Ready for the full Terraform Associate bank? Start free.

70 questions, timed mock exams, and missed-question review — 30 free questions, no card.

Start free trial
Terraform Associate study guide & details →