HashiCorp · Terraform-Associate
Terraform Associate 004 practice across Terraform 1.12 fundamentals, configuration, workflow, modules, state, troubleshooting, and HCP Terraform.
Practice Questions
628
≈ 11 practice exams
Duration
60 minutes
Passing Score
Not publicly disclosed
Difficulty
AssociateLast Updated
Oct 2026
Terraform Associate 004 validates foundational Terraform Community Edition and HCP Terraform knowledge for cloud engineers. It tests Terraform 1.12 across eight objectives: infrastructure as code, fundamentals, the core workflow, configuration, modules, state, maintenance and troubleshooting, and HCP Terraform.
The English exam is online-proctored, multiple choice, and one hour long. HashiCorp lists the price as $70.50 USD plus applicable taxes and fees, with no free retake, and does not publish a passing score or fixed question count. The credential expires after two years.
Use these 628 questions alongside a disposable lab. Practise init, validate, plan, apply, destroy, variables and outputs, provider constraints, dependency and lifecycle behaviour, modules, imports, state operations, troubleshooting, and HCP Terraform workspaces and projects. Version 004 added lifecycle rules, custom conditions, ephemeral values, write-only arguments, and workspace organization.
HashiCorp Certified: Terraform Associate 004 validates foundational Terraform Community Edition and HCP Terraform knowledge. Version 004 tests Terraform 1.12 and adds objectives for lifecycle rules, custom conditions, ephemeral values, write-only arguments, and organizing HCP Terraform workspaces and projects.
The exam is designed for cloud engineers in operations, IT, or development who understand foundational Terraform concepts and workflows. HashiCorp recommends production experience, but candidates may also prepare by performing the objectives in a personal demonstration environment.
There is no formal credential prerequisite. HashiCorp lists basic terminal skills and a basic understanding of on-premises and cloud architecture as prerequisites for preparation.
Associate 004 is a one-hour, English-language, online-proctored multiple-choice exam. HashiCorp lists $70.50 USD plus local taxes and fees, with no free retake. It does not publish a fixed passing score or question count. The credential expires after two years.
Terraform Associate demonstrates a portable infrastructure-as-code foundation across cloud platforms. It supports junior and mid-level cloud, platform, DevOps, and infrastructure work, while the Professional and Advanced Terraform credentials provide later paths for deeper production expertise.
5 sample questions with answers and explanations. The full bank has 628 questions, enough for 11 full-length practice exams.
Preview — answers shown1. A Terraform configuration uses the following expression to generate subnet CIDR blocks. What will be the output? cidrsubnet("10.0.0.0/16", 8, 3) (Select one!)
Explanation
The cidrsubnet function calculates subnet addresses by taking a prefix, adding newbits to the netmask, and using netnum to determine which subnet. The expression cidrsubnet(10.0.0.0/16, 8, 3) adds 8 bits to the /16 prefix creating /24 subnets, then selects the 3rd subnet (zero-indexed), which is 10.0.3.0/24. The second octet increments because with 8 new bits added to a /16, each increment of netnum adds 1 to the third octet. 10.0.0.3/24 would be incorrect subnet addressing. 10.3.0.0/24 would require modifying the wrong octet. 10.0.8.0/24 confuses the newbits parameter with the netnum parameter.
2. An infrastructure configuration uses cidrsubnet("10.0.0.0/16", 8, 3) to calculate a subnet CIDR block. What CIDR block does this function return? (Select one!)
Explanation
The cidrsubnet function calculates subnet addresses by extending the prefix length and selecting a specific subnet number. Given cidrsubnet("10.0.0.0/16", 8, 3), the function adds 8 bits to the /16 prefix creating /24 subnets, then selects the subnet at index 3. The base network is 10.0.0.0/16, adding 8 bits for subnetting creates 256 possible /24 subnets. Subnet 0 is 10.0.0.0/24, subnet 1 is 10.0.1.0/24, subnet 2 is 10.0.2.0/24, and subnet 3 is 10.0.3.0/24. This function is commonly used for programmatic subnet allocation in cloud network architectures.
3. A configuration uses the expression element(["a", "b", "c"], 5) to retrieve a value from a list. What value does this expression return? (Select one!)
Explanation
The element function retrieves values from a list and wraps around if the index exceeds the list length. For a list with 3 elements (indexes 0, 1, 2), requesting index 5 wraps using modulo arithmetic: 5 mod 3 = 2, which returns the third element c. This wrapping behavior differentiates element from standard list indexing [5] which would error. The function does not return null or errors for out-of-bounds indexes due to its modulo-based wrapping.
4. A team uses the expression cidrhost("192.168.1.0/24", 5) to calculate an IP address for a virtual machine. What IP address does this expression return? (Select one!)
Explanation
The cidrhost function calculates an IP address within a CIDR block by taking the network prefix and adding the specified host number. For the network 192.168.1.0/24, the base is 192.168.1.0, and adding 5 produces 192.168.1.5. The host number is added directly to the network address, not offset by one. The function does not manipulate other octets in the address or return the network base address.
5. A platform team creates Terraform test files to validate their infrastructure modules. What file extension must these test files use to be recognized by the terraform test command? (Select one!)
Explanation
Terraform test files must use the .tftest.hcl extension to be recognized by the terraform test command introduced in Terraform 1.6. These files are typically stored in a tests/ directory and contain run blocks with assertions to validate infrastructure behavior. The .tf extension is for regular configuration files. The .tftest extension without .hcl is not valid. The .test.tf extension is not recognized by Terraform's testing framework. Test files use HCL syntax similar to regular Terraform configurations but contain test-specific blocks like run and assert.
HashiCorp states that exam 004 tests Terraform 1.12.
It is a one-hour, English-language, online-proctored multiple-choice exam.
HashiCorp lists $70.50 USD plus applicable taxes and fees, with no free retake included.
HashiCorp does not publicly disclose a passing score. A claimed fixed percentage is not official.
There is no formal credential prerequisite. HashiCorp lists basic terminal skills and an understanding of on-premises and cloud architecture.
The credential expires after two years. Renewal options include retaking Associate 004 or qualifying through a higher-level Terraform exam.
$17.99
One-time access to this exam