HashiCorp Terraform Associate (004)
Write, plan, apply and manage infrastructure as code with Terraform and HCP Terraform. Lessons, exam-style practice, timed mocks and an AI tutor, mapped to every objective of the official exam guide.
Free Included · 7-day free trial
The exam
- Questions
- 57
- Time
- 60 minutes
- Passing score
- Not published
- Exam fee
- USD 70.50 plus locally applicable taxes and fees (free retake not included)
- Valid for
- 2 years
- Delivery
- Online proctored
Official exam page · booked with HashiCorp
Every section of the exam guide
8 sections and 37 objectives, in the official weights. Each lesson is mapped to the objectives it covers.
Section 1 · Infrastructure as Code (IaC) with Terraform6%
What the exam asks
- Explain what IaC is
- Describe the advantages of IaC patterns
- Explain how Terraform manages multi-cloud, hybrid cloud, and service-agnostic workflows
Lessons
- What Infrastructure as Code is and why it pays off
- Terraform across clouds, hybrid environments and services
Section 2 · Terraform fundamentals12%
What the exam asks
- Install and version Terraform providers
- Describe how Terraform uses providers
- Write Terraform configuration using multiple providers
- Explain how Terraform uses and manages state
Lessons
- Terraform providers: install, version and combine
- How Terraform uses and manages state
Section 3 · Core Terraform workflow12%
What the exam asks
- Describe the Terraform workflow
- Initialize a Terraform working directory
- Validate a Terraform configuration
- Generate and review an execution plan for Terraform
- Apply changes to infrastructure with Terraform
- Destroy Terraform-managed infrastructure
- Apply formatting and style adjustments to a configuration
Lessons
- The Terraform workflow and terraform init
- Validate, plan and apply
- Destroy and formatting
Section 4 · Terraform configuration24%
What the exam asks
- Use and differentiate
resourceanddatablocks - Refer to resource attributes and create cross-resource references
- Use variables and outputs
- Understand and use complex types
- Write dynamic configuration using expressions and functions
- Define resource dependencies in configuration
- Validate configuration using custom conditions
- Understand best practices for managing sensitive data, including secrets management with Vault
Lessons
- Resource and data blocks, and references between them
- Input variables, locals and outputs
- Complex types, expressions and functions
- Dependencies, lifecycle and custom conditions
- Managing sensitive data and secrets with Vault
Section 5 · Terraform modules10%
What the exam asks
- Explain how Terraform sources modules
- Describe variable scope within modules
- Use modules in configuration
- Manage module versions
Lessons
- Module sources and module versions
- Using modules and variable scope
Section 6 · Terraform state management10%
What the exam asks
- Describe the local backend
- Describe state locking
- Configure remote state using the backend block
- Manage resource drift and Terraform state
Lessons
- Local backend, state locking and remote state
- Resource drift and managing Terraform state
Section 7 · Maintain infrastructure with Terraform8%
What the exam asks
- Import existing infrastructure into your Terraform workspace
- Use the CLI to inspect state
- Describe when and how to use verbose logging
Lessons
- Importing existing infrastructure
- Inspecting state and verbose logging
Section 8 · HCP Terraform18%
What the exam asks
- Use HCP Terraform to create infrastructure
- Describe HCP Terraform collaboration and governance features
- Describe how to organize and use HCP Terraform workspaces and projects
- Configure and use HCP Terraform integration
Lessons
- Creating infrastructure with HCP Terraform
- Workspaces, projects, collaboration and governance
- Connecting the CLI and VCS to HCP Terraform
14-Day Standard Plan
The default path for engineers who have used Terraform a little but have not covered every exam objective. It covers all 21 lessons and all 15 labs in order, with a section drill after each section and daily flashcards. Configuration (t4) gets three days because it carries the most questions, and HCP Terraform (t8) gets a full day because it is the second largest topic. Mock Exam 1 and Mock Exam 2 come on days 13 and 14; Mock Exams 3 and 4 are for extra practice if you have time. Book the exam for day 15 or 16. About 1–2 hours a day.
- Day 1Kick-off: what IaC is, and how Terraform spans clouds
- Day 2Providers: install, version and combine
- Day 3State: what it stores and how plan uses it
- Day 4The core workflow: init, validate, plan, apply
- Day 5Destroy, fmt and the t3 drill
- Day 6Resources, data sources, references and variables
- Day 7Complex types, expressions, functions, dependencies and conditions
- … and 7 more days, with mock exams at the end
Sample questions
Written for practice in the style of the real exam: never questions from the real exam.
Sample question 1
A repository has a root module and a modules/network folder. After running terraform fmt in the root, the CI job terraform fmt -check -recursive still lists modules/network/main.tf. What explains this?
- AWithout
-recursive, fmt processed only the root directory, not subdirectories - BFmt cannot format files that define modules or are called from other configurations
- CFmt formats a file only if
terraform validatehas already passed for that directory - DThe lock file excluded the module from formatting because it has no providers
Show the answer
A. terraform fmt scans only the specified or current directory unless -recursive is given.
Sample question 2
A server was corrupted by a bad script, and the team wants to destroy and recreate just that server through a reviewable plan. Which command do they use?
- A
terraform taint aws_instance.web - B
terraform apply -replace="aws_instance.web" - C
terraform state rm aws_instance.webthenterraform apply - D
terraform refresh
Show the answer
B. The -replace=ADDRESS option on plan or apply forces replacement of a single object and shows the plan first. terraform taint is deprecated for this reason.
About this exam
Which Terraform version does the exam test?
Terraform 1.12, including HCP Terraform content. Features that arrived later than 1.12 are not required. Provider-specific knowledge is not needed; questions use AWS, Azure or Google Cloud only as examples.
How many questions are on the exam and what is the passing score?
HashiCorp does not publish either. It publishes a 1-hour duration and the format (multiple choice, online proctored). The mock exams here use 57 questions, a figure third-party sites report, so treat it as a practice size. HashiCorp says it does not share score percentages or the scoring threshold.
Is the exam proctored, and how?
Yes. It is online proctored and delivered through Certiverse. You book through the HashiCorp certification portal, launch it from My Exams, and follow the room, ID and device rules on the Exam day page. I could not confirm from HashiCorp's pages whether a given session is watched by a live proctor throughout or reviewed afterwards; follow the rules as if you were watched live.
What does it cost and can I retake it?
USD 70.50 plus locally applicable taxes and fees. A free retake is not included. After a failed attempt you wait 7 days, and you can attempt the exam at most 4 times in a rolling 365 days. If you pass, you cannot retake it until the credential expires.
How long is the certification valid?
2 years. HashiCorp's certification FAQ does not describe a renewal process beyond saying credentials expire, so check the certification page for the current renewal option when yours is near.
Do I need cloud experience or an account?
No cloud account is needed for this course. The labs use the local, random and null providers, optionally Docker, and the HCP Terraform free tier (up to 500 managed resources). The exam only expects you to read cloud examples. HashiCorp lists basic terminal skills and an understanding of on-premises and cloud architecture as the prerequisites.
Is it Terraform Cloud or HCP Terraform?
Terraform Cloud was renamed HCP Terraform in 2024. Both names refer to the same hosted service. Terraform Enterprise is the self-managed edition. Expect the exam and older material to use either name, so learn both.
What about OpenTofu?
OpenTofu is a separate, community-governed fork of Terraform under the Linux Foundation. The Associate exam is about Terraform itself, so answer from Terraform's documentation and behaviour.
What is the difference between the import block and terraform import?
Both bind an existing object to a resource address in state. The block lives in configuration, is previewed by plan, written to state by apply and can generate starter configuration. The command acts immediately with no preview and needs the resource block to exist first. The exam covers both.
Does marking a variable sensitive keep it out of state?
No. It only hides the value in CLI and UI output. It remains in state and plan files. To keep a value out of state use an ephemeral value with a write-only argument (ephemeral values since Terraform 1.10, write-only arguments since 1.11), or keep the secret out of Terraform with a dynamic credential mechanism such as Vault.
See where you stand in 8 minutes
Ten questions from this course, weighted like the real exam, with your score by section and a rough chance of passing.