HashiCorp Terraform Associate Practice Test

480+ exam grade questions across every domain, powered by AI assisted learning that gives you instant feedback and a clear explanation on every question.

8 Mock Exams
480+ Total Questions
70% Pass Rate
60 minutes Exam Duration
Question #1 Infrastructure as Code (IaC) with Terraform

A new hire is learning Terraform and asks how it decides what actions to take. A colleague explains that with Terraform you write configuration that describes the end result you want, and Terraform figures out the create, update, or delete steps needed to reach it. Which term best describes this approach to Infrastructure as Code?

Pick an answer to reveal the explanation.

Question #2 Core Terraform workflow

A developer is documenting the standard day-to-day Terraform workflow for a brand-new working directory, from first checkout to provisioned infrastructure. Which sequence of commands reflects the correct core workflow?

Pick an answer to reveal the explanation.

Question #3 Terraform fundamentals

An engineer clones a repository that uses the AWS provider and a registry module, then runs terraform init before anything else. Which statement best summarises the primary purpose of this command?

Pick an answer to reveal the explanation.

Question #4 Terraform configuration

An engineer is choosing between collection types for a module input and wants to confirm how list and map types behave in Terraform. Which statement is correct?

Pick an answer to reveal the explanation.

Question #5 Terraform state management

A developer writes a simple configuration with no backend or cloud block and runs terraform apply. What is the name of the file where Terraform stores state on the local disk by default?

Pick an answer to reveal the explanation.

Question #6 Core Terraform workflow

A junior engineer is learning which Terraform commands can actually create, modify, or destroy real cloud resources versus those that only read or analyse configuration. Which of the following commands can change real infrastructure?

Pick an answer to reveal the explanation.

Question #7 Terraform modules

A platform team keeps a reusable networking module in a subdirectory at ./modules/network. An engineer wants to call this module from the root configuration and pass it a CIDR block as an input. Which block correctly calls the local module?

Pick an answer to reveal the explanation.

Question #8 HCP Terraform

A platform team is moving to HCP Terraform and a new engineer asks what a single HCP Terraform workspace actually represents. Which description is most accurate?

Pick an answer to reveal the explanation.

Question #9 Terraform configuration

A platform engineer is creating one aws_s3_bucket per environment name from the set ["dev", "staging", "prod"]. They want each bucket tracked in state under a stable key based on its environment name, so that adding or removing one environment never disturbs the others. Which meta-argument should they use, and why?

Pick an answer to reveal the explanation.

Question #10 Maintain infrastructure with Terraform

An engineer wants to view all of the stored attributes (such as the ID, ARN, and tags) of one specific resource that Terraform is tracking, for example aws_instance.web, directly from the state without contacting the cloud provider. Which command shows the attributes of that single resource?

Pick an answer to reveal the explanation.

Question #11 Infrastructure as Code (IaC) with Terraform

An architect states the following during a design review: "Terraform is cloud-agnostic. Through its provider ecosystem it can manage resources on AWS, Azure, Google Cloud, on-premises platforms, and many SaaS services using the same configuration language and workflow." Is this statement true or false?

Pick an answer to reveal the explanation.

Question #12 Terraform fundamentals

An engineer is setting up a new repository and is deciding what to commit to Git. A teammate claims the .terraform.lock.hcl dependency lock file should be committed so that everyone installs identical provider versions. Is the statement "The .terraform.lock.hcl file should be committed to version control" true or false?

Pick an answer to reveal the explanation.

Question #13 Core Terraform workflow

An engineer wants their team's Terraform files to follow a consistent indentation and alignment style before committing. Which command automatically rewrites .tf files to the canonical HashiCorp formatting?

Pick an answer to reveal the explanation.

Question #14 Terraform state management

A platform team is moving from a local state file on one laptop to a shared remote backend so multiple engineers can collaborate safely. Which of the following is a genuine benefit of using a remote backend instead of local state?

Pick an answer to reveal the explanation.

Question #15 Terraform configuration

After applying a configuration, an engineer wants Terraform to print the public DNS name of a load balancer so it can be consumed by another tool and shown at the end of terraform apply. The attribute is aws_lb.app.dns_name. Which block correctly exposes this value?

Pick an answer to reveal the explanation.

Question #16 Core Terraform workflow

An automated deployment pipeline runs terraform apply in a non-interactive environment. The job hangs because Terraform is waiting for someone to type yes at the approval prompt. The engineer wants Terraform to apply the planned changes without pausing for interactive confirmation, while still letting Terraform compute the plan at apply time. Which approach is correct?

Pick an answer to reveal the explanation.

Question #17 Terraform modules

An engineer wants to pin a module to a specific version and is unsure when the version argument inside a module block is actually honoured by Terraform. For which kind of module source is the version argument valid?

Pick an answer to reveal the explanation.

Question #18 HCP Terraform

A team is evaluating what moving to HCP Terraform would give them beyond a plain remote backend. Which capability does HCP Terraform provide?

Pick an answer to reveal the explanation.

Question #19 Maintain infrastructure with Terraform

An engineer wants to stop Terraform from managing a shared S3 bucket but must keep the real bucket and its data intact. A teammate warns that running terraform state rm on the bucket will delete it from the cloud. Is the statement "Running terraform state rm on a resource destroys the underlying real cloud resource" true or false?

Pick an answer to reveal the explanation.

Question #20 Terraform configuration

A team needs to look up the ID of an existing, centrally managed Route 53 hosted zone so they can add DNS records to it. They must not create, modify, or destroy the hosted zone itself; another team owns it. They only need to read its attributes. Which Terraform block type should they use?

Pick an answer to reveal the explanation.

Frequently asked questions about the TF-004 exam

What is the HashiCorp Terraform Associate (TF-004) certification?

The Terraform Associate (004) is the foundational HashiCorp certification that validates your understanding of Infrastructure as Code concepts, the core Terraform workflow, state management, modules, and HCP Terraform. The 004 version became the current exam in January 2026, replacing 003, and tests on Terraform 1.12. It is aimed at cloud engineers, DevOps engineers, and SREs who use Terraform in operations or development and want to prove baseline proficiency with the industry-standard IaC tool.

How many questions are on the Terraform Associate exam and how long is it?

The Terraform Associate exam runs for 1 hour in an online proctored environment and contains approximately 57 questions (HashiCorp does not publish an exact count). Question formats are true/false, multiple choice, and multiple answer, all answerable from conceptual knowledge — there are no hands-on lab tasks, although practical Terraform experience makes the scenario questions much easier.

What is the passing score for the Terraform Associate exam?

HashiCorp does not publish an official passing score and never shares your score percentage — your result is reported simply as pass or fail, shown immediately after you finish, with a detailed per-objective performance report available in the certification portal about 48 hours later. The 70% threshold widely cited in the community is an estimate, and Sailor.sh mock exams use it as their passing score. Consistently scoring 85% or above on realistic mock exams is the safest signal that you are ready.

What topics does the Terraform Associate (004) exam cover?

The exam is organized into eight domains: Infrastructure as Code (IaC) with Terraform, Terraform fundamentals, the core Terraform workflow, Terraform configuration, Terraform modules, Terraform state management, maintaining infrastructure with Terraform, and HCP Terraform. New in 004 are topics such as resource lifecycle rules (depends_on, create_before_destroy), custom validation conditions, ephemeral values, and HCP Terraform workspaces and projects — and the exam uses the HCP Terraform name exclusively instead of Terraform Cloud.

Is the Terraform Associate exam beginner friendly?

Yes. It is an associate-level, multiple-choice exam and the most accessible HashiCorp certification, with no formal prerequisites — HashiCorp assumes only basic terminal skills and a basic understanding of on-premises and cloud architecture. Candidates who spend a few weeks building real configurations — running init, plan, and apply, writing variables and modules, and breaking and fixing state — combined with focused mock exam practice routinely pass on the first attempt.

How much does the Terraform Associate exam cost and how long is it valid?

The exam costs USD 70.50 plus applicable taxes, making it one of the most affordable cloud and DevOps certifications. Note that Associate-level purchases cover a single attempt — there is no free retake, and retakes require a new purchase after a seven-day waiting period. The certification is valid for two years from the date you pass, and you can renew by passing the then-current exam version starting six months before expiry.

How should I prepare for the Terraform Associate (TF-004) exam?

Start with the official exam objectives and study guide on the HashiCorp Developer site, and work through the Terraform tutorials hands-on. Then drill realistic mock exams that mirror the real test format, review the explanation for every wrong answer, and re-practice your weakest objectives — state management, module versioning, and HCP Terraform features catch out the most candidates — until you consistently score above 85%.

Limited Time Offer: Get 80% off all Mock Exam Bundles | Sale ends in 7 days. Start learning today.

Claim Now