
HashiCorp
HashiCorp Certified: Terraform Associate (004)
The Terraform Associate certification validates knowledge of fundamental Terraform Community Edition and HCP Terraform concepts and skills. It is designed for cloud engineers with professional experience using Terraform in production environments. The exam tests on Terraform 1.12 and covers topics including IaC concepts, core workflow, configuration, modules, state management, and HCP Terraform.
10 exam-weighted questions. No account needed to start.
Verified with official sources · Nov 23, 2026
Official facts last checked Nov 23, 2026
Exam guide version 004
- Current official exam guide and objectives
- Official exam overview
- Official credential renewal options
- HashiCorp passing-score policy
- Official reference for reviewed catalog guidance
- Official reference for reviewed catalog guidance
- Official reference for reviewed catalog guidance
- Official reference for reviewed catalog guidance
- Official reference for reviewed catalog guidance
- Official reference for reviewed catalog guidance
- Official renewal information
CertForge practice settings and study guidance are our own, separate from the official exam facts.
- Version
- 004
- CertForge difficulty
- Intermediate
- Estimated study time
- 45 hours
Passing score
Not publicly disclosed
Duration
60 minutes
Questions
Not publicly published
Validity
2 years
How to prepare
A plan built from the verified exam facts, plus CertForge study notes.
Set a schedule
CertForge estimates about 45 hours of study. That is roughly 5 weeks at 10 hours a week, or 9 weeks at 5.
Know how it is scored
The provider does not publish a passing score, so aim for consistent, comfortable practice results across every domain.
Plan for renewal
The certification is valid for 2 years. Put a reminder in your calendar well before it lapses.
CertForge study notes
Terraform Associate 004 assesses foundational Terraform Community Edition and HCP Terraform knowledge. Official sample items use true/false, single-answer, and multiple-answer selection; configuration snippets are question content, rather than a separate hands-on response format.
Focus on
- State is the central concept the entire exam orbits — nearly every domain touches it. Understanding what state IS (a mapping of config to real-world resources), what happens when it drifts, how locking prevents corruption, and why remote backends exist will unlock answers across multiple domains, not just the State Management section.
- Terraform Associate 004 tests Terraform 1.12. Review custom conditions, ephemeral values, write-only arguments, and HCP Terraform workspace/project organization. The provider publishes objectives without domain percentage weights.
- The HCP Terraform questions test conceptual boundaries more than CLI mechanics — specifically, you must understand WHEN to use workspaces vs. projects for governance, what the workspace run workflow adds over local runs, and how Sentinel/policy-as-code fits into the governance story, even at a high level.
Common mistakes
- Candidates study terraform init/plan/apply as rote steps but fail questions about WHAT those commands actually do internally — for example, not knowing that init downloads providers and modules into .terraform/, or that plan reads both config AND state to compute a diff, causing them to miss scenario questions about partial failures and state inconsistencies.
- Treating modules as an advanced topic and skimming them, when in reality the exam heavily tests variable scoping and the distinction between root module outputs, child module outputs, and how resource attributes are referenced across module boundaries — a conceptual gap that surfaces in both Modules and Configuration questions.
Approach every question by asking 'what does Terraform's state and dependency model say should happen here?' rather than 'what command do I run?' — candidates who internalize Terraform as a state reconciliation engine rather than a script executor will reason correctly through novel scenarios they've never seen before.
What the exam covers
8 domains. The provider does not publish domain weights.
Infrastructure as Code (IaC) with Terraform
Covers the foundational concepts of Infrastructure as Code, the advantages of IaC patterns, and how Terraform manages multi-cloud, hybrid cloud, and service-agnostic workflows.
Study tips
This domain tests conceptual understanding rather than hands-on skills, so expect definition-based and scenario-driven questions about why IaC matters. Focus on the specific advantages Terraform offers over manual provisioning and traditional scripts, such as idempotency, version control, and declarative syntax. Understanding how Terraform's provider model enables multi-cloud and hybrid workflows without vendor lock-in is the conceptual anchor of this domain.
- Idempotency and declarative vs. imperative IaC approaches
- Terraform's provider-based multi-cloud abstraction model
- Business and operational advantages of IaC: drift detection, repeatability, collaboration
Relatively low difficulty but easy to overthink. Questions often have one clearly correct answer if you understand the declarative model. Do not confuse Terraform-specific features with general IaC concepts.
Terraform Fundamentals
Covers the foundational elements of Terraform including providers, state management, and how Terraform uses plugins to interact with infrastructure APIs.
Study tips
This domain bridges concepts and practice, focusing on how providers are installed, versioned, and used within configurations. Pay close attention to provider version constraints syntax (e.g., ~>, >=, =) and the role of the .terraform.lock.hcl file in locking provider versions. Understanding how Terraform state acts as the source of truth for managed infrastructure is foundational to succeeding in later domains.
- Provider version constraint syntax and the lock file (.terraform.lock.hcl)
- The required_providers block and provider source addresses
- State as the mapping between configuration and real-world infrastructure
Candidates often confuse provider versioning with module versioning. Also note that the lock file tracks provider versions, not module versions — a common exam trap.
Core Terraform Workflow
Covers the fundamental Terraform CLI workflow including initialization, planning, applying, destroying, formatting, and validating configurations.
Study tips
Study the write, plan, and apply workflow and the roles of init, validate, fmt, and destroy. Initialize a working directory when needed; destroy is an optional operation when removing infrastructure, rather than a required step in every workflow cycle.
- Exact behavior and output of each CLI command: init, validate, plan, apply, destroy, fmt
- What terraform init downloads and configures (providers, modules, backend)
- Difference between terraform validate (syntax/logic) and terraform plan (API-level drift detection)
A common pitfall is conflating terraform validate with terraform plan. Validate only checks configuration syntax and internal consistency — it does not contact provider APIs or detect real infrastructure drift.
Terraform Configuration
Covers writing and managing Terraform configuration using HCL, including resources, data sources, variables, outputs, expressions, functions, dependencies, validation, and sensitive data management.
Study tips
Study resource and data blocks, variables, outputs, types, expressions, dependencies, and custom conditions. The 004 objectives include ephemeral values and write-only arguments for sensitive data handling. HashiCorp does not publish domain percentages.
- Resource vs. data source blocks: lifecycle, read-only vs. managed resources
- Variable types, validation blocks, and output sensitive arguments
- Expressions: count, for_each, dynamic blocks, for expressions, conditional ternary, and built-in functions
- Custom validation and checks; ephemeral values and write-only arguments in Terraform 1.12
The most common pitfall is misunderstanding count vs. for_each behavior when resources are removed from a list — for_each is generally safer for non-ordered collections. Also know that sensitive = true on outputs prevents values from appearing in CLI output but does not encrypt state.
Terraform Modules
Covers the use and creation of Terraform modules to organize, reuse, and share infrastructure configuration.
Study tips
Module questions focus on sourcing, structure, and encapsulation. Understand the difference between local path modules, Terraform Registry modules, and Git-sourced modules, including the source address syntax for each. Variable scope is critical — child modules cannot access root module variables unless explicitly passed, and outputs must be explicitly declared to expose values upward.
- Module source types: local paths, Terraform Registry (namespace/module/provider), Git URLs
- Module version pinning using the version argument (Registry modules only)
- Variable input/output flow: passing variables into modules and consuming module outputs
The module version argument applies only to modules installed from a registry, including a private registry. Git sources select revisions with ref; a Git tag does not make the version argument valid. Run terraform init after changing registry module versions.
Terraform State Management
Covers managing Terraform state including local and remote backends, state locking, resource drift detection, and state manipulation.
Study tips
This domain tests your understanding of state as both a technical artifact and an operational concern. Focus on the mechanics of remote backends (especially S3 and HCP Terraform as common examples), how state locking prevents concurrent modifications, and the specific scenarios that constitute resource drift. Know how to configure a backend block and understand what terraform state commands are available for operational management.
- Remote backend configuration via the backend block and what terraform init does with it
- State locking: which backends support it, what happens when a lock is not released
- Resource drift: detecting drift with terraform plan and reconciling with terraform apply or terraform state
The local backend supports state locking through operating-system APIs. Understand each backend's locking behavior before using force-unlock. Sensitive marking hides values in normal output, but does not itself encrypt state; ephemeral values and write-only arguments can omit supported values from stored artifacts.
Maintain Infrastructure with Terraform
Covers maintaining existing infrastructure including importing resources, inspecting state, and troubleshooting with verbose logging.
Study tips
Study importing existing infrastructure, inspecting state, and verbose logging. The classic terraform import command needs matching configuration; configuration-driven import blocks can use plan -generate-config-out to generate configuration. HashiCorp does not publish a lower weighting for this domain.
- Classic CLI import and configuration-driven import blocks, including optional configuration generation
- terraform state subcommands: list, show, mv, rm, pull, push
- TF_LOG and TF_LOG_PATH environment variables for verbose debugging
A critical pitfall: terraform import does not generate configuration automatically (in the classic workflow) — you must write the resource block first. Also note that terraform state rm removes a resource from state tracking without destroying the actual infrastructure.
HCP Terraform
Covers HashiCorp Cloud Platform (HCP) Terraform including workspace management, collaboration features, governance, projects, and CLI integration.
Study tips
HCP Terraform questions focus on its role as a remote backend, collaboration platform, and governance layer. Understand workspaces as isolated state environments, how runs are triggered and executed remotely, and the difference between free and paid governance features like Sentinel policies and audit logging. Know how to configure the cloud block (the modern replacement for the remote backend block) to integrate local CLI with HCP Terraform.
- The cloud block configuration for HCP Terraform CLI integration vs. the legacy remote backend block
- Workspace organization: projects, tags, and variable sets for sharing variables across workspaces
- Governance features: Sentinel policy as code, RBAC, audit trails (know which tier enables which)
Do not confuse HCP Terraform workspaces with Terraform CLI workspaces (terraform workspace command) — they are conceptually different. HCP Terraform workspaces are full isolated environments with their own state, variables, and run history, while CLI workspaces share the same configuration with separate state files.
Suggested study split
CertForge guidance for planning practice. These percentages are not official exam weights.
- Domain 1: 12.5%
- Domain 2: 12.5%
- Domain 3: 12.5%
- Domain 4: 25%
- Domain 5: 12.5%
- Domain 6: 12.5%
- Domain 7: 6.25%
- Domain 8: 6.25%
10 free Terraform Associate 004 sample questions
Written and checked by hand against the official documentation linked from each answer. Try each one before you open the answer.
Question 1 · Core workflow
Which two actions does `terraform init` perform? (Select two.)
- A.Downloads the provider plugins the configuration requires
- B.Creates the resources defined in the root module
- C.Initializes the backend that will store the state
- D.Rewrites configuration files into the canonical format
- E.Checks your cloud credentials against the provider API
Show answer
Answers: A and C
`terraform init` prepares a working directory: it initializes the backend, installs modules and downloads providers. It never creates infrastructure (`apply` does), formatting is `terraform fmt`, and credentials are only used when a plan or apply calls the provider.
terraform init command
Show 9 more sample questionsHide the other 9
Question 2 · State
A teammate deletes a virtual machine in the cloud console. Terraform manages that VM and nobody changed the configuration. What does the next `terraform plan` show?
- A.No changes, because the state file still lists the VM
- B.An error, because state no longer matches the real world
- C.A plan to create the VM again to match the configuration
- D.A plan to remove the VM block from the configuration
Show answer
Answer: C
By default `plan` refreshes state against the real infrastructure first. Terraform sees the VM is gone, and because the configuration still declares it, it proposes creating it again. Terraform never edits your configuration files.
terraform plan commandQuestion 3 · Variables
The variable `region` is set in three places: `TF_VAR_region=us-east-1` in the environment, `region = "us-west-2"` in `terraform.tfvars`, and `-var="region=eu-west-1"` on the command line. Which value does Terraform use?
- A.us-east-1
- B.us-west-2
- C.eu-west-1
- D.Terraform stops and reports a conflict
Show answer
Answer: C
Later sources override earlier ones: environment variables, then `terraform.tfvars`, then `terraform.tfvars.json`, then `*.auto.tfvars` files, then `-var` and `-var-file` options in the order given. The command-line value wins.
Input variables: variable definition precedenceQuestion 4 · Modules
Which module source lets you pin a release with the `version` argument?
- A.A local path such as `./modules/network`
- B.A Git repository URL such as `git::https://example.com/net.git`
- C.A module registry address such as `hashicorp/consul/aws`
- D.An HTTPS URL that points to a zip archive
Show answer
Answer: C
The `version` argument only works for modules installed from a registry (the public Terraform Registry or a private registry such as HCP Terraform's). For Git sources you pin with `?ref=` in the URL; local paths have no version.
Module blocks: versionQuestion 5 · Configuration
Users are created with `count = length(var.users)` from the list `["ana", "ben", "cy"]`. You remove `"ana"` from the list. What does Terraform plan, and what avoids it?
- A.It destroys only ana; switching to for_each would not change that
- B.It changes or replaces ben and cy too; for_each keyed by name avoids it
- C.It refuses to plan until you run `terraform state rm` for ana
- D.It destroys every user and recreates them; nothing avoids it
Show answer
Answer: B
With `count`, instances are tracked by index. Removing the first element shifts ben to index 0 and cy to index 1, so Terraform plans changes to them and destroys index 2. `for_each` over a set or map tracks instances by key, so only ana is destroyed.
The for_each meta-argumentQuestion 6 · Security
A variable that holds a database password is declared with `sensitive = true`. Which statement is true?
- A.The value is hidden in plan and apply output but is still stored in state
- B.The value is encrypted in the state file with a key that Terraform manages for you
- C.The value is never written to state or plan files
- D.The value can only be passed in through an environment variable
Show answer
Answer: A
`sensitive` only redacts the value from CLI output. It is still written to state in plain text, which is why state needs a protected backend. To keep a value out of state and plan files entirely, use an ephemeral value instead.
Input variables: suppressing values in CLI outputQuestion 7 · Security
You need a short-lived token during a run, and it must not be persisted in the plan file or in state. Which feature fits?
- A.Declare the variable with `sensitive = true`
- B.Declare the variable with `ephemeral = true`
- C.Store the token in a local value instead of a variable
- D.Mark the output that uses it with `sensitive = true`
Show answer
Answer: B
Ephemeral input variables (and ephemeral outputs and resources) are available during the run but are not stored in plan or state files. Terraform only allows them in places that don't persist, such as provider configuration and write-only arguments.
Input variables: exclude values from stateQuestion 8 · State
You want to bring an existing EC2 instance under Terraform management and have Terraform draft the resource configuration for you. What do you use?
import { to = aws_instance.web id = "i-0abc123def4567890" }- A.This block, then `terraform plan -generate-config-out=generated.tf`
- B.This block, then `terraform apply -refresh-only` to write the config
- C.`terraform state mv` from the instance ID to `aws_instance.web`
- D.`terraform refresh`, which adds unmanaged resources to state
Show answer
Answer: A
An `import` block declares the import in configuration, and `plan -generate-config-out` writes a draft resource block for anything that has no configuration yet. Review the generated file, then apply. `state mv` only renames existing addresses, and refresh never adopts unmanaged resources.
Import existing resourcesQuestion 9 · Configuration
A production database resource has `lifecycle { prevent_destroy = true }`. A change to an argument would force replacement. What happens on `terraform plan`?
- A.Terraform replaces it but takes a snapshot of the database first
- B.Terraform skips the database and applies the remaining changes
- C.Terraform reports an error because the plan would destroy it
- D.Terraform creates the replacement first, then keeps both copies
Show answer
Answer: C
`prevent_destroy` makes Terraform reject any plan that would destroy the object, including a replacement, with an error. It does not take snapshots or skip resources. To go ahead you must remove the setting or change the plan.
The lifecycle meta-argumentQuestion 10 · HCP Terraform
Your security team wants every HCP Terraform run checked against rules such as "no public S3 buckets" before it can apply. Which feature does that?
- A.Policy enforcement with Sentinel or OPA policy sets
- B.Run triggers that connect one workspace to another
- C.Variable sets shared across the organization
- D.Projects that group related workspaces together under shared team access
Show answer
Answer: A
Policy sets (written in Sentinel or OPA) are evaluated after the plan and before apply, and a failed mandatory policy blocks the run. Run triggers chain workspaces, variable sets share values, and projects organize workspaces and permissions.
Policy enforcement in HCP Terraform
See where you stand across every domain
10 exam-weighted questions. No account needed to start.
Checked for Terraform Associate (004), Terraform 1.12 on 2026-11-11. These are separate from the CertForge practice bank.
Why prepare with CertForge
Practice built around the HashiCorp Certified: Terraform Associate (004) exam, not generic quizzes.
Full practice exams
Timed 57-question practice exams in 60 minutes, so exam day feels familiar.
Explanations for every answer
Each question explains why the right answer is right and why the others are not.
Progress by domain
See how you are doing across all 8 exam domains and where to focus next.
Review your mistakes
Go back over the questions you missed until the concepts stick.
Flashcards
Quick review sessions for the facts and services you need to recall fast.
Checked questions
Written against the official exam objectives and reviewed before use. Every question has a Report button.
How our questions are checkedFeature availability depends on your plan. Compare plans
Compare certifications
Ready to start preparing?
Practice with exam-style questions and track your progress by domain.
- 57
- Practice questions
- 60
- Practice minutes
- 70%
- Practice passing benchmark
CertForge practice settings, separate from the official exam facts.