Chapter 15: Exam Preparation Guide#
π― Learning Objectives#
- Understand the Terraform Associate certification exam structure
- Master the key exam domains and topics
- Practice with realistic sample questions
- Use study strategies for passing the exam
- Access additional resources and practice tests
15.1 Exam Overview#
Terraform Associate 003 (Latest)#
| Detail | Information |
|---|---|
| Exam Name | HashiCorp Certified: Terraform Associate (003) |
| Format | Multiple choice, multiple select |
| Duration | 60 minutes |
| Questions | 57 questions |
| Passing Score | 70% (approximately) |
| Cost | $70.50 USD (plus tax) |
| Delivery | Online proctored |
| Validity | 2 years |
| Languages | English, Japanese |
Exam Domains#
| Domain | Weight | Focus Areas |
|---|---|---|
| 1. Infrastructure as Code | 12% | IaC concepts, benefits, best practices |
| 2. Terraform Basics | 18% | Installation, providers, resources, state |
| 3. Terraform Workflow | 16% | Init, plan, apply, destroy, fmt, validate |
| 4. Terraform Configuration | 18% | Variables, outputs, locals, expressions |
| 5. Terraform State | 14% | Remote state, backends, locking |
| 6. Terraform Modules | 12% | Module structure, registry, versioning |
| 7. Terraform Cloud & Enterprise | 10% | Workspaces, Sentinel, remote operations |
15.2 Exam Preparation Strategy#
4-Week Study Plan#
| Week | Focus | Activities |
|---|---|---|
| Week 1 | Foundation (Ch 1-4) | Read chapters, run examples, practice commands |
| Week 2 | Core Skills (Ch 5-8) | Build modules, configure backends, use workspaces |
| Week 3 | Advanced (Ch 9-12) | Dynamic blocks, import, refactor, functions |
| Week 4 | Exam Prep (Ch 13-15) | Review all, take practice tests, weak areas |
Study Resources#
| Resource | Type | Link |
|---|---|---|
| Official Study Guide | Document | HashiCorp Learn |
| Review Guide | Exam Review Guide | |
| Sample Questions | Practice | HashiCorp Sample Questions |
| Practice Exams | Third-party | Udemy, Whizlabs, Tutorials Dojo |
| Hands-on Labs | Interactive | HashiCorp Learn Tutorials |
15.3 Key Concepts to Master#
Must-Know Commands#
| Command | Purpose | Exam Frequency |
|---|---|---|
terraform init |
Initialize directory, download providers | π΄ High |
terraform plan |
Show execution plan | π΄ High |
terraform apply |
Apply changes | π΄ High |
terraform destroy |
Destroy resources | π΄ High |
terraform fmt |
Format code | π‘ Medium |
terraform validate |
Validate syntax | π‘ Medium |
terraform state list |
List resources in state | π‘ Medium |
terraform state mv |
Move/rename in state | π‘ Medium |
terraform state rm |
Remove from state | π‘ Medium |
terraform import |
Import existing resources | π‘ Medium |
terraform workspace |
Manage workspaces | π‘ Medium |
terraform output |
Show output values | π’ Low |
terraform console |
Interactive console | π’ Low |
Critical Concepts (Exam Focus)#
| Concept | Why It’s Tested |
|---|---|
| Provider version constraints | Understanding ~>, >=, = syntax |
| State locking | DynamoDB for S3 backend |
| Backend configuration | Cannot use variables in backend block |
| Variable precedence | -var > *.auto.tfvars > terraform.tfvars > TF_VAR_ > default |
| Resource dependencies | Implicit vs explicit (depends_on) |
| Lifecycle rules | create_before_destroy, prevent_destroy, ignore_changes |
| count vs for_each | When to use each, index shifting |
| Provisioners | Last resort, alternatives preferred |
| Workspaces | Pros/cons vs directory-based environments |
| Terraform Cloud | VCS workflow, remote execution, Sentinel |
| Sensitive data | sensitive = true, state encryption |
| Module sources | Registry, local, GitHub, S3, Git |
15.4 Sample Practice Questions#
Domain 1: Infrastructure as Code (12%)#
Q1: What is a key benefit of Infrastructure as Code?
- A) Manual configuration of servers
- B) Reproducible infrastructure deployments
- C) Faster network connectivity
- D) Reduced cloud costs
Q2: Which of the following is a declarative IaC approach?
- A) Writing a shell script to install packages
- B) Defining the desired state of infrastructure in configuration files
- C) Using a configuration management tool to run commands in sequence
- D) Manually clicking through a cloud provider’s console
Domain 2: Terraform Basics (18%)#
Q3: What command initializes a Terraform working directory?
- A)
terraform start - B)
terraform init - C)
terraform setup - D)
terraform begin
Q4: Which version constraint allows minor version updates but not major version changes?
- A)
= 1.0 - B)
~> 1.0 - C)
>= 1.0 - D)
< 2.0
Q5: What is the purpose of the .terraform.lock.hcl file?
- A) Store state file
- B) Lock provider versions for reproducibility
- C) Lock the state file to prevent concurrent access
- D) Store Terraform configuration
Domain 3: Terraform Workflow (16%)#
Q6: Which Terraform command creates an execution plan without modifying infrastructure?
- A)
terraform apply - B)
terraform plan - C)
terraform show - D)
terraform import
Q7: When should you run terraform fmt?
- A) Before
terraform init - B) After writing configurations, before committing
- C) Only on failed plans
- D) Never β it’s automatic
Q8: What does the -auto-approve flag do?
- A) Automatically approves the plan without interactive confirmation
- B) Only applies approved resources
- C) Skips the plan phase
- D) Approves only newly created resources
Domain 4: Terraform Configuration (18%)#
Q9: What is the correct syntax for a conditional expression in Terraform?
- A)
if condition then value else default - B)
condition ? true_value : false_value - C)
condition ? value : else - D)
switch(condition, true_value, false_value)
Q10: Which meta-argument should be used to create resources based on a map of values?
- A)
count - B)
for_each - C)
depends_on - D)
lifecycle
Q11: What does the following expression return: [for s in ["a", "bb", "ccc"] : length(s)]?
- A)
["a", "bb", "ccc"] - B)
[1, 2, 3] - C)
[3, 2, 1] - D)
["1", "2", "3"]
Domain 5: Terraform State (14%)#
Q12: What is the recommended way to manage Terraform state in a team environment?
- A) Share a local state file via Git
- B) Use remote state storage with locking
- C) Store state in a shared network drive
- D) Each team member maintains their own state
Q13: Which AWS service provides state locking for S3-backed remote state?
- A) RDS
- B) DynamoDB
- C) ElastiCache
- D) SQS
Q14: What happens if someone manually deletes a resource managed by Terraform?
- A) Terraform automatically recreates it on the next apply
- B) Terraform detects drift and shows it in the plan
- C) The state file becomes corrupted
- D) Terraform throws an error and stops
Domain 6: Terraform Modules (12%)#
Q15: True or False: When you call a module from the Terraform Registry, you must specify a version constraint.
- A) True
- B) False
Q16: Which pattern is used to reference a module installed from the public registry?
- A)
source = "github.com/namespace/name" - B)
source = "./modules/name" - C)
source = "namespace/name/provider" - D)
source = "https://registry.terraform.io/name"
Q17: What is the purpose of module outputs?
- A) To display information in the console during apply
- B) To return values from a module for use in the calling configuration
- C) To store state information
- D) To define module dependencies
Domain 7: Terraform Cloud & Enterprise (10%)#
Q18: What is the Sentinel feature in Terraform Cloud?
- A) A monitoring tool for infrastructure
- B) A policy-as-code framework for enforcing compliance
- C) A security scanning tool
- D) A secrets management service
Q19: What happens when a pull request is opened against a VCS-connected workspace?
- A) Terraform Cloud automatically applies the changes
- B) Terraform Cloud creates a speculative plan and posts it as a comment
- C) Nothing β changes must be manually triggered
- D) The workspace is locked
Q20: Which execution mode runs Terraform operations on Terraform Cloud servers?
- A) Local execution
- B) Remote execution
- C) Agent execution
- D) Cloud execution
15.5 Answer Key#
π Click to show answers
| # | Answer | Explanation |
|---|---|---|
| 1 | B | Reproducibility is a key benefit of IaC |
| 2 | B | Declarative defines desired state, not steps |
| 3 | B | terraform init initializes the working directory |
| 4 | B | ~> 1.0 means >= 1.0 and < 2.0 |
| 5 | B | .terraform.lock.hcl locks provider versions |
| 6 | B | terraform plan shows execution plan without applying |
| 7 | B | terraform fmt formats code, best done before committing |
| 8 | A | -auto-approve skips interactive confirmation |
| 9 | B | condition ? true_value : false_value |
| 10 | B | for_each works with maps and sets |
| 11 | B | Returns lengths: [1, 2, 3] |
| 12 | B | Remote state with locking for teams |
| 13 | B | DynamoDB provides state locking |
| 14 | B | Drift detected on next plan |
| 15 | A | Registry modules require version constraint |
| 16 | C | Registry uses namespace/name/provider format |
| 17 | B | Outputs return values from modules |
| 18 | B | Sentinel is policy-as-code for compliance |
| 19 | B | Speculative plan is created on PR |
| 20 | B | Remote execution runs on Terraform Cloud |
15.6 Quick Reference Cheat Sheet#
Terraform Commands#
# Workflow
init β Initialize directory, download providers
plan β Show execution plan
apply β Apply changes
destroy β Destroy resources
# Development
fmt β Format code
validate β Validate syntax
console β Interactive console
# State
state list β List resources in state
state show β Show resource attributes
state mv β Move/rename in state
state rm β Remove from state
state pull β Pull state to local
# Import
import β Import existing resources
# Workspaces
workspace new β Create workspace
workspace select β Switch workspace
workspace list β List workspaces
workspace show β Show current workspaceVersion Constraints#
= 1.0 β Exactly 1.0
~> 1.0 β >= 1.0, < 2.0
~> 1.5 β >= 1.5, < 2.0
~> 1.5.0 β >= 1.5.0, < 1.6.0
>= 1.0 β 1.0 or higher
>= 1.0, < 2.0 β RangeVariable Precedence (Highest to Lowest)#
1. -var or -var-file flag
2. *.auto.tfvars files
3. terraform.tfvars
4. TF_VAR_ environment variables
5. Default valueKey Functions#
lookup(map, key, default) β Safe map access
cidrsubnet(prefix, bits, netnum) β Subnet CIDR
file(path) β Read file content
templatefile(path, vars) β Template rendering
merge(map1, map2) β Merge maps
concat(list1, list2) β Concatenate lists
flatten(list) β Flatten nested lists
coalesce(val1, val2, ...) β First non-null
try(expr1, expr2, default) β Graceful error handling
can(expr) β Test if expression succeeds15.7 Exam Day Tips#
Before the Exam#
- β Review cheat sheet one final time
- β Get 8 hours of sleep
- β Test your computer/webcam/internet
- β Find a quiet, well-lit room
- β Have your ID ready (government-issued)
- β Close all other applications
- β Install the proctoring software early
During the Exam#
- β±οΈ You have ~1 minute per question
- β Flag difficult questions and return later
- βοΈ Elimination strategy: remove clearly wrong answers
- π Read each question twice β watch for double negatives
- π Look for keywords: “NOT”, “ALWAYS”, “NEVER”, “BEST”
- π For “choose two” questions, partial credit is NOT given
Common Traps to Avoid#
| Trap | How to Avoid |
|---|---|
Mixing up count and for_each |
Remember: count for numbers, for_each for maps/sets |
Forgetting terraform init runs first |
It’s always the first command |
| Backend can’t use variables | Backend configuration is static |
prevent_destroy vs ignore_changes |
One prevents delete, one ignores attribute changes |
terraform plan vs terraform apply |
Plan is read-only, apply makes changes |
| Provisioner timing | When provisioners run (create vs destroy) |
| Module source formats | Registry vs local vs Git formats |
15.8 Additional Resources#
Official Resources#
Practice Exams#
- Tutorials Dojo - Terraform Associate Practice Exams
- Whizlabs - Terraform Associate Practice Tests
- ExamPro - Terraform Associate Practice
Community#
Books#
- “Terraform: Up & Running” by Yevgeniy Brikman
- “The Terraform Book” by James Turnbull
β Your Exam Readiness Checklist#
[ ] Can explain IaC benefits and Terraform's role
[ ] Have installed Terraform and configured AWS
[ ] Can write Terraform configurations with resources
[ ] Understand variables, outputs, and locals
[ ] Can create and use modules
[ ] Understand state management and remote backends
[ ] Can import existing resources
[ ] Understand workspaces and environment strategies
[ ] Have practiced with terraform test
[ ] Can explain provisioners and their alternatives
[ ] Understand Terraform Cloud features
[ ] Have taken at least 3 practice exams
[ ] Consistently score 80%+ on practice exams
[ ] Reviewed all chapters in this guide
[ ] Can explain each exam domainYou’ve got this! Good luck on your Terraform Associate certification!
This is the final chapter of the Terraform Learning Path. Good luck with your certification!