HashiCorp · exam Terraform 004 · Intermediate · Cloud, Software & DevOps
Terraform Associate practice questions, in short shifts
Free practice questions for the HashiCorp Certified: Terraform Associate (004) (Terraform 004) exam, mapped to the official objectives, with the reason behind every answer. Study a topic in fifteen minutes, come back tomorrow, and watch your readiness score move.
The free bank has 85 original questions in 17 shifts. Each one pairs a short Terraform Associate study guide with five questions, so it works as a study guide and as a Terraform 004 practice exam in small pieces.
Try three now. No account needed.
3 sample questions from the free Terraform Associate practice test bank, from different exam areas. Pick your answer, then open the explanation.
Question 1 · Infrastructure as Code (IaC) with Terraform
An operations team builds each new environment by following a wiki page and clicking through a cloud console. Environments often end up slightly different from each other. Which change is the best example of moving to infrastructure as code?
- ARecord a video of the console steps so that every engineer clicks the same options in the same order
- BGive one senior engineer sole responsibility for building every environment by hand from now on
- CDefine the environment in configuration files in version control and let a tool build it from them
- DTake a full backup of the first environment and write down its settings in a shared spreadsheet
Show answerHide answer
Answer: C. Define the environment in configuration files in version control and let a tool build it from them
- ✗ AThe work is still manual and can still vary between people. Nothing is defined in files that a tool can run.
- ✗ BThis may reduce variation, but the infrastructure is still built by hand and is not defined in versioned files.
- ✓ CCorrect. IaC means the infrastructure is described in versioned configuration files and a tool creates it from those files, which makes each build repeatable.
- ✗ DA backup and a spreadsheet document what exists, but they do not define the infrastructure in files that a tool applies.
Question 2 · Terraform fundamentals
A configuration contains this block: required_providers { aws = { source = "hashicorp/aws", version = "~> 5.2" } }. There is no lock file yet. Which provider versions is terraform init allowed to select?
- AVersion 5.2 and any later 5.x release, but not 6.0
- BOnly patch releases of 5.2, such as 5.2.1 or 5.2.9
- CVersion 5.2 and any later release, including 6.0
- DExactly version 5.2.0, and no earlier or later one
Show answerHide answer
Answer: A. Version 5.2 and any later 5.x release, but not 6.0
- ✓ ACorrect. With ~> only the last version part written may increase, so ~> 5.2 allows 5.2 up to, but not including, 6.0.
- ✗ BThat is what ~> 5.2.0 would allow. With two parts written, the minor version is the part that may increase.
- ✗ CThat describes >= 5.2. The ~> operator sets an upper limit, here below 6.0.
- ✗ DAn exact pin is written as = 5.2.0 or just 5.2.0. The ~> operator allows a range.
Question 3 · Core Terraform workflow
An engineer has just written a configuration for a new project in an empty directory. Which sequence of commands follows the core Terraform workflow to turn this configuration into running infrastructure?
- A`terraform plan`, then `terraform init`, then `terraform apply`
- B`terraform init`, then `terraform plan`, then `terraform apply`
- C`terraform apply`, then `terraform plan`, then `terraform init`
- D`terraform validate`, then `terraform plan`, then `terraform apply`
Show answerHide answer
Answer: B. `terraform init`, then `terraform plan`, then `terraform apply`
- ✗ AThe plan would fail, because the directory has no providers installed and no backend set up until `terraform init` has run.
- ✓ BCorrect. Init prepares the directory, plan previews the changes for review, and apply makes them.
- ✗ CThis is the reverse order. Nothing can be planned or applied before the directory is initialized.
- ✗ DValidate also needs an initialized directory, and without `terraform init` the plan has no providers to work with.
What the Terraform 004 exam covers
The exam covers 8 areas. The percentages show roughly how much of the exam each one makes up, and our free questions follow the same areas.
Infrastructure as Code (IaC) with Terraform
Explain what IaC is; Describe the advantages of IaC patterns; Explain how Terraform manages multi-cloud, hybrid cloud, and service-agnostic workflows.
3 topics · 5 free questions
8%Terraform fundamentals
Install and version Terraform providers; Describe how Terraform uses providers; Write Terraform configuration using multiple providers; Explain how Terraform uses and manages state.
4 topics · 10 free questions
11%Core Terraform workflow
Describe the Terraform workflow; Initialize a Terraform working directory; Validate a Terraform configuration; Generate and review an execution plan for Terraform; and 3 more.
7 topics · 15 free questions
19%Terraform configuration
Use and differentiate resource and data blocks; Refer to resource attributes and create cross-resource references; Use variables and outputs; Understand and use complex types; and 4 more.
8 topics · 20 free questions
22%Terraform modules
Explain how Terraform sources modules; Describe variable scope within modules; Use modules in configuration; Manage module versions.
4 topics · 10 free questions
11%Terraform state management
Describe the local backend; Describe state locking; Configure remote state using the backend block; Manage resource drift and Terraform state.
4 topics · 10 free questions
11%Maintain infrastructure with Terraform
Import existing infrastructure into your Terraform workspace; Use the CLI to inspect state; Describe when and how to use verbose logging.
3 topics · 5 free questions
8%HCP Terraform
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.
4 topics · 10 free questions
10%
Based on the official Terraform 004 exam outline. Check it before you book, since details can change. Break Shift is independent and isn't affiliated with or endorsed by HashiCorp.
Why short shifts work
Short sessions spread over days give better recall than one long sitting, and answering questions teaches more than rereading. So each Terraform Associate shift is one topic, a short guide and five questions, small enough to finish on a break. See the research behind it.
Terraform Associate questions, answered
Are these the real Terraform 004 exam questions?
No. Every question is original, written in the exam's style from the official Terraform 004 objectives. The questions on the exam itself are confidential, and the exam will word things differently.
Is the Terraform Associate practice free?
Yes. All 85 questions in the free bank, a study guide for every topic and your readiness score are free with an account. No card needed. Premium adds fresh practice written for the topics you miss, and timed concept tests.
How long does a Terraform Associate study shift take?
About fifteen minutes: a short guide to one topic, then five practice questions with the reason behind every answer.