TechNuggets Academy
TA-004

Free HashiCorp Certified: Terraform Associate (004) Practice Test

12 exam-style questions with full explanations — no sign-up. Score yourself, then close your gaps with the full course.

Exam fee ~$70.58 exam domainsLevel Beginner-Intermediate2 timed practice tests in the course
Free practice — no sign-up📝 Real exam-style questions💡 Detailed explanations💸 30-day money-back via Udemy
Question 1 of 12 · Understand infrastructure as code (IaC) concepts
A company's operations team manually configures each new server through ad-hoc SSH sessions. Over time, servers that were supposed to be identical have started behaving differently, and nobody can explain why. Which IaC advantage BEST addresses this problem?
IaC written declaratively and stored in version control ensures every environment is provisioned from the same source of truth, eliminating the drift caused by manual, undocumented changes.
Question 2 of 12 · Understand Terraform's purpose (vs other IaC)
A platform team currently uses shell scripts to imperatively call cloud provider APIs to create VMs, networks, and load balancers, one command at a time. They want to move to a tool that describes the desired end state of infrastructure, automatically determines the order of operations, and shows a preview of changes before anything is applied. Which approach BEST meets these requirements?
Terraform's HCL is declarative — you describe the desired end state, and Terraform's engine builds a resource graph to determine dependency order automatically. `terraform plan` generates an execution plan showing exactly what will be created, changed, or destroyed before any action is taken.
Question 3 of 12 · Terraform fundamentals: providers and state basics
Your team wants the AWS provider to automatically pick up patch-level bug fixes (e.g., 5.10.1, 5.10.2) but never accept a minor or major version bump like 5.11.0 or 6.0.0. Which version constraint should you use in the required_providers block?
The pessimistic constraint operator ~> 5.10.0 (three-part version) locks the rightmost segment, allowing only patch releases within 5.10.x (5.10.1, 5.10.2, etc.) while blocking 5.11.0 or higher.
Question 4 of 12 · The core Terraform workflow (Write, Plan, Apply)
A DevOps engineer runs `terraform plan` and sees a resource listed as: `-/+ resource "aws_instance" "web" will be replaced, as requested`. What does the `-/+` symbol combination indicate?
The `-/+` prefix in plan output means destroy-then-create replacement — the resource cannot be updated in place because a changed attribute forces recreation.
Question 5 of 12 · Write and maintain Terraform configuration (HCL)
A Terraform configuration includes this variable block: variable "instance_count" { type = number } The team wants to enforce that instance_count is always greater than 0, and display a custom error message if it is not, without using a separate provider or external tool. Which block should be added inside the variable block to satisfy this requirement?
Input variable custom validation requires a validation block nested inside the variable block, and that block must contain exactly two arguments: condition (a boolean expression) and error_message (the string shown when condition is false).
Question 6 of 12 · Interact with Terraform modules
A team wants to reuse a VPC module from the public Terraform Registry. They need to automatically receive patch-level bug fixes but must NOT automatically receive minor or major version changes. Which version constraint achieves this?
The pessimistic constraint operator ~> 3.0 (with two version segments) allows only the rightmost component to increment, permitting 3.0.1, 3.0.2, etc., but excluding 3.1.0 or 4.0.0 — exactly patch-only updates.
Question 7 of 12 · Manage Terraform state and remote backends
A team of five engineers all run `terraform apply` from their local machines against the same infrastructure using the default local backend. They frequently encounter corrupted state and conflicting changes when two people apply around the same time. Which change BEST resolves this?
Remote backends with locking (HCP Terraform, or S3 with its native conditional-write locking, or the older S3+DynamoDB pattern) prevent concurrent writes to state, which is exactly the corruption/conflict scenario described.
Question 8 of 12 · Understand HCP Terraform (Terraform Cloud) capabilities
A platform team manages 40 HCP Terraform workspaces that all need the same AWS credentials and a shared 'environment=prod' variable, but they don't want to copy-paste these variables into every workspace individually. Which HCP Terraform feature BEST meets this requirement?
Variable sets let you define a group of variables (including sensitive ones) once and attach them to multiple workspaces or an entire project, avoiding duplication and easing updates.
Question 9 of 12 · Understand infrastructure as code (IaC) concepts
A company needs to provision resources across AWS, Azure, and an on-premises VMware cluster using a single configuration language and workflow. Which Terraform capability makes this possible?
Terraform Core is provider-agnostic; provider plugins translate a single HCL workflow (init/plan/apply) into calls against each platform's API, enabling true multi-cloud and hybrid-cloud management.
Question 10 of 12 · Understand Terraform's purpose (vs other IaC)
An organization is deciding how to divide responsibilities between Terraform and Ansible when managing both the provisioning of new AWS EC2 instances and the ongoing installation of packages on those instances. Which statement BEST describes how the two tools typically complement each other in this scenario?
Terraform excels at provisioning cloud infrastructure resources and tracking their real-world state in a state file, enabling create/update/destroy planning. Ansible excels at configuration management — installing packages, managing files, and configuring software on already-provisioned hosts. Using each tool for its strength is the standard complementary pattern.
Question 11 of 12 · Terraform fundamentals: providers and state basics
What is the primary purpose of the .terraform.lock.hcl file?
The dependency lock file is generated by terraform init and records the specific provider versions and cryptographic checksums that satisfy the required_providers constraints, guaranteeing everyone on the team gets the same provider builds.
Question 12 of 12 · The core Terraform workflow (Write, Plan, Apply)
Which command checks that a Terraform configuration is syntactically valid and internally consistent, without contacting any remote APIs or backends?
terraform validate checks syntax and internal consistency (e.g., argument types, references) using only the local configuration and cached provider schema; it does not need network or backend access.
Ready for the real thing?

The full course: two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed explanations.

undefined $34.99 with code FREETEST33 — valid through Sep 23.

Get my $34.99 deal →

TA-004 exam — quick answers

How much does the TA-004 exam cost?

The exam fee is approximately $70.5 and varies by region — confirm current pricing with the certification vendor before you book.

What topics are on the exam?

It covers 8 domains: Understand infrastructure as code (IaC) concepts (~8%), Understand Terraform's purpose (vs other IaC) (~8%), Terraform fundamentals: providers and state basics (~14%), The core Terraform workflow (Write, Plan, Apply) (~16%), Write and maintain Terraform configuration (HCL) (~16%), Interact with Terraform modules (~12%), Manage Terraform state and remote backends (~14%), Understand HCP Terraform (Terraform Cloud) capabilities (~12%). The full course has a dedicated chapter, lab and practice-test coverage for each.

Is this practice test really free?

Yes — all questions on this page are free with explanations and no sign-up. The paid Udemy course adds two full-length timed exams, video lessons and hands-on labs.

How do I get the discount?

Use code FREETEST33 at checkout for $34.99 (list undefined) through Sep 23 — the enroll button applies it automatically.

Will this prepare me for the real exam?

The questions mirror the real exam's style and are mapped to the official domains. This is exam-focused preparation — combine the free test with the full course's timed simulations to gauge your readiness.

More free practice by exam domain:
Terraform fundamentals: providers and state basics →The core Terraform workflow (Write, Plan, Apply) →Write and maintain Terraform configuration (HCL) →Manage Terraform state and remote backends →