HashiCorp Certified: Terraform Associate cheat sheet
HashiCorp
Free to share. Examworthy is not affiliated with or endorsed by HashiCorp; TF-Associate-004 and related marks belong to their respective owners.
At a glance
Format: Online proctored, multiple choice
Domain weight map
Heaviest first - spend your time hereHow this exam thinks
Terraform Associate 004 rewards knowing what each command and construct actually does in the write, plan, apply workflow, not memorising every function.
Spot the trap
Tempting wrong answers, and why they failTempting but wrong
Changing a variable to tuple([string, string]) satisfies for_each, because a fixed-length tuple is the collection it expects.
Why it fails
A tuple looks like an ordered pair that might suit two zones, but for_each rejects tuples just as it rejects lists; it needs a map or a set.
Terraform configuration
Tempting but wrong
Because apply already generated its own plan during the same command, it applies the changes immediately.
Why it fails
Apply does generate its own plan, but without a saved plan file or -auto-approve it still stops and asks for confirmation first.
Core Terraform workflow
Tempting but wrong
Every provider must be pinned in a required_providers block before any plugin can be installed.
Why it fails
Pinning in required_providers is best practice for version control, but its absence does not stop init. Terraform can still infer and install the provider, so requiring the pin overstates the rule.
Terraform fundamentals
Tempting but wrong
A module block pointing at a subdirectory makes init query the public registry and download the newest matching version.
Why it fails
Registry retrieval is tempting because init does fetch registry modules, but a registry source must be a namespaced address such as 'namespace/name/provider', not a relative path.
Terraform modules
Tempting but wrong
The 'local' provider decides where Terraform persists state.
Why it fails
It is tempting to conflate the 'local' provider with the local backend, but providers manage resources and never decide where state is stored.
Terraform state management
Tempting but wrong
The cost estimation feature inspects the plan and refuses to apply resources that create a security risk.
Why it fails
Cost estimation is a genuine HCP Terraform feature and runs at a similar point in the run, which makes it tempting, but it only reports projected spend and never blocks a run for a security condition.
HCP Terraform
Tempting but wrong
Terraform's main advantage is faster provisioning, because it always creates cloud resources more quickly than the console.
Why it fails
Speed can improve, but Terraform is not guaranteed to be faster than the console, and speed is not what fixes environments that differ from each other.
Infrastructure as Code (IaC) with Terraform
Tempting but wrong
terraform state show can enumerate the whole list of resource addresses in state.
Why it fails
terraform state show requires a specific resource address argument and prints that one resource's attributes, so it cannot enumerate the whole list of addresses.
Maintain infrastructure with Terraform
Key terms
Exam-day rules
- Answer as 004, not 002 or 003. Prefer HCP Terraform over Terraform Cloud and -replace over taint; the outdated term is usually the distractor.
- Ask which step changes infrastructure. Only apply and destroy do; init, validate, plan and fmt change nothing, and questions turn on that line.
- Know variable precedence cold: command-line -var or -var-file beats TF_VAR_ environment variables, which beat terraform.tfvars and auto.tfvars files, which beat defaults.
- Remember sensitive hides values from output but state still stores them in plaintext, so protecting state is the real control, not the sensitive flag.
- Read the last line of the question first. It tells you what is actually being asked, so you can read the scenario looking for the answer.
Revision schedule
- Day 1Map the objectives and confirm you are studying 004
- Week 1Ground the concepts and fundamentals (Objectives 1 and 2)
- Week 1-2Drill the core workflow until it is automatic (Objective 3)
- Week 2-3Go deep on configuration (Objective 4)
- Week 3-4Cover modules, state and maintenance (Objectives 5, 6 and 7)