Terraform & IaC Roadmap
Complete Terraform learning path from HCL basics to advanced modules, state management, CI/CD integration, and multi-cloud deployments.
IaC Fundamentals
Why Infrastructure as Code matters
What to learn
- Manual infra vs IaC — why codify infrastructure
- Declarative vs imperative approaches
- Terraform vs CloudFormation vs Pulumi vs CDK
- Installing Terraform and setting up providers
- HCL syntax basics — blocks, arguments, expressions
Key tools
Core Terraform
Resources, variables, outputs, and data sources
What to learn
- Resources — creating, updating, destroying infra
- Variables — types, defaults, validation, sensitive
- Outputs — exposing values between modules
- Data sources — reading existing infrastructure
- Locals — computed values and expressions
- Terraform plan, apply, destroy workflow
Key tools
State Management
Remote state, locking, and state operations
What to learn
- Local vs remote state — why remote matters
- S3 + DynamoDB backend for state locking
- State commands — list, show, mv, rm, import
- State drift detection and refresh
- Terraform import for existing resources
- Preventing state corruption
Key tools
Modules
Reusable, composable infrastructure
What to learn
- Module structure — main.tf, variables.tf, outputs.tf
- Local modules vs Terraform Registry modules
- Module versioning and pinning
- Nested modules and composition patterns
- Module testing with Terratest
- Publishing modules to private registries
Key tools
Advanced HCL
Loops, conditionals, and dynamic blocks
What to learn
- count vs for_each — when to use which
- Dynamic blocks for repeated nested configs
- Conditional expressions and feature flags
- for expressions and map transformations
- Type constraints and custom validation rules
- Terraform functions — lookup, merge, flatten, cidrsubnet
Key tools
Multi-Environment & Workspaces
Dev, staging, prod without duplication
What to learn
- Workspaces for environment separation
- tfvars files per environment
- Directory structure patterns — mono vs multi-repo
- Terragrunt for DRY multi-environment configs
- Backend configuration per environment
- Promoting infrastructure changes across environments
Key tools
CI/CD & Policy as Code
Automate Terraform in pipelines with guardrails
What to learn
- Terraform in GitHub Actions / GitLab CI
- Plan file workflow — plan → review → apply
- Terraform Cloud / Spacelift for managed runs
- OPA/Sentinel for policy enforcement
- Cost estimation with Infracost
- Drift detection and scheduled plans
- State locking in CI/CD pipelines
Key tools
Interview Prep
DevOps Interview Prep Bundle — 1000+ Q&A
Every topic on this roadmap has interview questions in the bundle — Docker, Kubernetes, AWS, CI/CD, Linux, SRE, FinOps, System Design. Grab it before your next interview.
Frequently Asked Questions
Common questions about the Terraform & IaC roadmap