Terraform Associate course and practice exam: HashiCorp Terraform Associate (004)

This Terraform Associate course has 34 video lessons and 52 graded labs, and its Terraform Associate practice exam follows the official exam objectives: a 20-question sampler free with an account, the full question bank and timed mock exams with Pro.

Infrastructure as code with Terraform, from workflow to state

Prepares you for Terraform Associate (004): infrastructure as code concepts, the Terraform workflow, configuration, modules, state and HCP Terraform.

Intermediate · 3 hours · 34 lessons · 77 labs

Terraform Associate exam guide

The Terraform Associate exam (HashiCorp Certified: Terraform Associate (004), by HashiCorp): 1 hour; cost: USD 70.50 plus locally applicable taxes and fees (no free retake included).

How do I prepare for the Terraform Associate exam?

Study the resources in HashiCorp's learning path in the order they appear, use the exam content list for any one objective, and check the sample questions to see the question format. Practise every objective in a personal demo setup. HashiCorp, Terraform Associate (004) study guide

How to prepare for the Terraform Associate (004) exam

  • Format: Multiple choice
  • Duration: 1 hour
  • Questions: Not published
  • Pass mark: Not published
  • Cost: USD 70.50 plus locally applicable taxes and fees (no free retake included)
  • Valid for: 2 years
  • Delivery: Online proctored
  • Prerequisites: Basic terminal skills; understanding of on-premises and cloud architecture

Exam domains

  • Infrastructure as Code (IaC) with Terraform
  • Terraform fundamentals
  • Core Terraform workflow
  • Terraform configuration
  • Terraform modules
  • Terraform state management
  • Maintain infrastructure with Terraform
  • HCP Terraform

HashiCorp does not publish domain weights for this exam.

A 20-question practice sampler is free with an account; Pro adds the full question bank and timed mock exams.

10 Terraform Associate sample questions with answers: free to read, no account needed.

Common questions

How long is the Terraform Associate exam?

The Terraform Associate exam lasts 1 hour.

How much does the Terraform Associate exam cost?

USD 70.50 plus locally applicable taxes and fees (no free retake included).

Is there a free Terraform Associate practice test?

Yes. A 20-question practice sampler is free with an account; Pro adds the full question bank and timed mock exams.

Source: HashiCorp Infrastructure Automation Certifications page (Terraform Associate 004 details) (HashiCorp), checked 2026-10-02.

Related guides

Who it is for

Intermediate level.

For engineers who use or are starting to use Terraform at work and want the HashiCorp Terraform Associate certificate.

What you don't need yet:

What helps:

No formal prerequisites. The courses under "Take first" cover what helps.

Take first:

Take next:

Learning paths:

Nobody needs to know everything before they start. Each course builds on the one before, so a learning path takes you there step by step.

What this exam proves, and what it doesn't

Terraform Associate is a multiple-choice exam: passing shows you know Terraform's workflow and language. It doesn't test hands-on skill or replace managing real infrastructure; our graded labs run real Terraform in your browser.

Exam objectives this course teaches

HashiCorp Certified: Terraform Associate (004)

Labs

77 labs, 52 of them graded: you write the code, it runs, and graded labs check the result. The outline lists each lesson's labs.

What is free

Start free: First module free with an account. Pro: Every course, lab, handbook, practice exam and certificate.

Course outline

Start Here

  1. The Plan That Wanted To Destroy Production (3 labs): You can read a Terraform plan line by line, explain why renaming a resource plans a destroy and a create, fix it with a moved block, and know how this course maps to the 37 objectives of the Terraform Associate (004) exam.
  2. One Hour, No Weights Published (1 lab): You know the exam's format and question styles, how to pace sixty minutes, why this course weights practice by objective count, and the Terraform features newer than 1.12 that the labs may show but the exam does not test.

IaC And Fundamentals

  1. Infrastructure As Code, And One Workflow For Every Platform (1 lab): You can explain what infrastructure as code is, name its advantages over manual changes, tell declarative from imperative tools, and explain how one Terraform workflow manages multi-cloud, hybrid and service-agnostic infrastructure through providers.
  2. Providers: How Terraform Reaches Every API (2 labs): You can explain how Terraform core and provider plugins divide the work, read a required_providers entry and its source address, say where terraform init installs providers from, and recognise what a missing or uninstalled provider looks like.
  3. Versions, The Lock File And Provider Aliases (3 labs): You can write provider version constraints, explain what the dependency lock file records and when terraform init -upgrade changes it, and configure two copies of one provider with alias and the provider meta-argument.
  4. State: Terraform's Memory Of What It Built (2 labs): You can explain why Terraform needs state, what the state file holds (resource bindings, metadata, serial and lineage, sensitive values in plain text), where it is stored by default, and how state, configuration and real objects are compared during a plan.

Core Workflow

  1. Write, Plan, Apply, And What Init Prepares (2 labs): You can describe the core Terraform workflow, list what terraform init sets up (backend, modules, providers, lock file), recognise when init must run again, and choose the init flags the exam names.
  2. Reading A Plan, Saving It, Applying It (2 labs): You can read every plan symbol (create, update in place, replace both ways, destroy, read), explain known after apply and forces replacement, save a plan and apply exactly that plan, and describe how apply behaves with and without a plan file.
  3. Validate, Format, Destroy, And The Flags That Bend A Plan (3 labs): You can say what terraform validate checks and what it cannot, format configuration with terraform fmt and its -check, -diff and -recursive flags, destroy safely with plan -destroy and destroy, and choose between -replace, -refresh-only and -target.

Configuration

  1. Resources, Data Sources And The References Between Them (2 labs): You can choose between a resource block and a data block, write references to resource, data, variable, local, module and path values, read an address with an index or key, and explain when a data source is read during plan or deferred to apply.
  2. Input Variables, Outputs, And Which Value Wins (2 labs): You can declare input variables with type, default, description and sensitive, set them six ways and predict which value wins, declare outputs and read them with terraform output, -raw and -json, and tell variables, locals and outputs apart.
  3. Complex Types: Lists, Sets, Maps, Objects And Tuples (2 labs): You can choose between list, set, map, object and tuple types, write type constraints with optional attributes and defaults, predict how Terraform converts values to a declared type, and read the error when a value does not fit.
  4. Expressions And Functions: Making Configuration Compute (2 labs): You can write conditional expressions, for expressions with filters in list and map form, splat expressions and string templates with directives, call built-in functions by family, render a file with templatefile, and test any expression in terraform console.
  5. Count, For Each And Dynamic Blocks (3 labs): You can repeat resources with count and with for_each, predict how removing an item affects each, choose between them, follow the rules for their values, and generate nested blocks with a dynamic block.
  6. Dependencies, depends_on And Lifecycle Rules (3 labs): You can explain how references create implicit dependencies in Terraform's graph, add depends_on for a hidden dependency, read terraform graph, and use create_before_destroy, prevent_destroy, ignore_changes and replace_triggered_by appropriately.
  7. Custom Conditions: Validation, Pre And Postconditions, Checks (4 labs): You can write variable validation rules, preconditions and postconditions in a lifecycle block, and check blocks; predict when each runs and whether it fails the run or only warns; and prove the conditions with terraform test and expect_failures.
  8. Sensitive Data, Ephemeral Values And Secrets From Vault (5 labs): You can explain what sensitive does and does not protect, protect state, use ephemeral variables and ephemeral resources, explain write-only arguments, and describe how the Vault provider supplies secrets, including dynamic secrets, without leaving them in state.

Modules

  1. Where Modules Come From (3 labs): You can explain what a module is, call a local module, recognise every module source address type the exam uses (local path, public and private registry, Git, HTTP and bucket archives, subdirectories), and say which sources accept a version argument and how init installs them.
  2. Module Scope: What Goes In, What Comes Out (2 labs): You can explain variable scope in modules, pass values into a child module through its input variables, read values out through its outputs, wire modules together through the root, and pass providers to a child module.
  3. Module Versions: Pin, Upgrade, Re-Initialise (2 labs): You can constrain registry module versions, read semantic versions, choose narrow or minimum constraints, pin Git modules with ref, upgrade with terraform init -upgrade, and recognise the errors for a version on a local path and a changed source before init.

State

  1. The Local Backend, And Workspaces On One Machine (2 labs): You can describe the local backend (where it stores state, how to set its path, what it locks and what it cannot share), use CLI workspaces with it and find each workspace's state, and explain why local state does not suit a team.
  2. State Locking: One Writer At A Time (3 labs): You can explain what state locking protects against, which operations take the lock, which backends support it (including S3's native lock file), and when to use -lock-timeout, -lock=false and terraform force-unlock.
  3. Remote State With The Backend Block (3 labs): You can write a backend block and its rules, supply settings by partial configuration at init, migrate existing state with terraform init -migrate-state or start fresh with -reconfigure, and read another configuration's outputs with the terraform_remote_state data source.
  4. Drift: When Reality Stops Matching State (2 labs): You can define drift, detect it with a normal plan or terraform plan -refresh-only, choose between reverting it with apply and accepting it with apply -refresh-only plus a configuration change, use ignore_changes for attributes another system owns, and name the tools for reshaping state.

Maintain Infrastructure

  1. Importing What Terraform Did Not Build (2 labs): You can bring existing infrastructure under Terraform with the terraform import command and with import blocks, generate configuration with -generate-config-out, check the result with a plan that shows no changes, and state the limits that apply in Terraform 1.12.
  2. Moved And Removed Blocks: Refactoring Without Rebuilding (4 labs): You can refactor resources into modules and from count to for_each with moved blocks, stop managing a resource without destroying it using a removed block with destroy = false, read the plan lines each produces, and choose these blocks over terraform state mv and state rm.
  3. Inspecting And Repairing State From The CLI (2 labs): You can inspect state with terraform state list, state show, show, show -json and output, change it with state mv, state rm and state pull, predict the plan that follows each change, and protect yourself with a backup and the preferred blocks.
  4. Verbose Logging: TF_LOG And Friends (1 lab): You can turn on Terraform's verbose logs with TF_LOG and its levels, write them to a file with TF_LOG_PATH, separate core and provider logs with TF_LOG_CORE and TF_LOG_PROVIDER, say when logging helps, and handle logs safely because they can contain secrets.

HCP Terraform

  1. Runs In HCP Terraform: The cloud Block And Remote Execution (3 labs): You can connect a configuration to HCP Terraform with the cloud block and terraform login, say where a plan executes under remote, local and agent execution modes, follow a run through its stages from pending to applied, and explain what changes when state and runs move to HCP Terraform.
  2. HCP Workspaces, Projects And Variable Sets: Which Value Wins? (1 lab): You can tell an HCP Terraform workspace from a CLI workspace, organize workspaces into projects for team access, share values with variable sets at global, project and workspace scope, and work out which value a run uses when the same key is set in several places.
  3. Collaboration And Governance: Teams, Policies, Registry And Health (1 lab): You can match a governance problem to the HCP Terraform feature that handles it: teams and permissions, the private registry, Sentinel and OPA policy sets with their enforcement levels, run tasks, dynamic credentials, health assessments, the explorer and change requests, and predict what a policy check does to a run.
  4. VCS, CLI And API Workflows: Speculative Plans And Run Triggers (2 labs): You can choose between the VCS-driven, CLI-driven and API-driven workflows, say which runs are speculative plans that can never be applied, package a configuration for the API workflow, predict which workspaces a run trigger reaches, and migrate state and pin the Terraform version when a configuration moves into HCP Terraform.

Mock And Review

  1. Trap Sprint: Twelve Answers That Are Almost True (1 lab): You can spot twelve classic Terraform Associate traps: count index shifts, renames without moved blocks, CLI versus HCP workspaces, sensitive values in state, what fmt and -target really do, version constraints, the lock file, refresh-only, removed blocks, import, and implicit dependencies.
  2. The Full Mock: Sixty Minutes, Eight Areas, One Plan For The Last Week (1 lab): You can sit a timed mock across all eight exam areas, mark it by area with each area counted by its number of objectives, find the area that puts the most of the exam at risk, and plan the last days before the exam and any retake.