What is Terraform?
Terraform is an infrastructure-as-code tool. Instead of clicking through a cloud console, you describe servers, networks, databases and permissions in text files, and Terraform creates, updates or deletes them to match. The same code can rebuild an entire environment in minutes.
It works with AWS, Azure, Google Cloud, Kubernetes, Cloudflare, GitHub and hundreds of other services. DevOps engineers, cloud engineers and SREs use it daily, and it shows up in a huge number of job listings. OpenTofu is an open-source fork that works almost the same way.
How to use this Terraform roadmap
You need basic knowledge of one cloud provider first. Pair this roadmap with the AWS, Azure or Google Cloud roadmap.
Always run terraform destroy on learning projects when you’re done, and keep a budget alert active on your cloud account.
1Step 1: Infrastructure as code basics
Why teams describe infrastructure in code.
What is it?
This step covers what infrastructure as code is, how Terraform fits in and the core workflow you’ll use every day.
What to learn
Memorise the core loop: init, plan, apply, destroy. Read every plan before applying it.
Learn each topic here
What IaC solves
Repeatable environments, code review for infrastructure and no more "it was set up by hand".
Declarative vs imperative
Describing the end state you want rather than the steps to get there.
Installing Terraform
Installing the CLI and setting up provider credentials safely.
The core workflow
terraform init, plan, apply and destroy.
Why it matters: Reading the plan carefully prevents most accidents.
Terraform vs other tools
How it compares with CloudFormation, Bicep, Pulumi, Ansible and OpenTofu.
Example
bash
terraform init # download providers
terraform plan # preview changes
terraform apply # make the changes
terraform destroy # remove everythingThe four commands you will use all the time.
Helpful resource: HashiCorp: Get started with Terraform
2Step 2: HCL, providers and resources
Write your first real configurations.
What is it?
Terraform code is written in HCL. This step covers its syntax, providers, resources, data sources and outputs.
What to learn
Keep the provider documentation open while writing. Every resource lists its arguments and examples.
Learn each topic here
HCL syntax
Blocks, arguments, expressions and comments.
Providers
Plugins that talk to a platform’s API, such as aws, azurerm or google.
Resources
The things Terraform creates, like a VM, network or DNS record.
Data sources
Reading existing information, such as the latest machine image or an existing network.
Outputs and dependencies
Printing useful values and how Terraform orders resources automatically.
Example
hcl
provider "aws" { region = "me-central-1" }
resource "aws_s3_bucket" "site" {
bucket = "my-site-2026-demo"
}
output "bucket_name" { value = aws_s3_bucket.site.bucket }A provider, one resource and an output.
Helpful resource: Terraform Registry
3Step 3: Variables and state
Make code reusable and understand state.
What is it?
Variables make configurations flexible, and state is how Terraform remembers what it created. Managing state well is one of the most important Terraform skills.
What to learn
Never edit the state file by hand. Use terraform state commands, and keep state in a remote backend.
Learn each topic here
Input variables and locals
Parameters for your code and named values for reuse.
Variable files and validation
tfvars files per environment and rules that reject bad values.
The state file
A record mapping your code to real resources.
Why it matters: Lost or corrupted state is a serious problem in real teams.
Remote backends and locking
Storing state in S3, Azure Storage, GCS or HCP Terraform with locking to prevent conflicts.
Sensitive values
Marking secrets as sensitive and keeping them out of code and logs.
Example
hcl
terraform {
backend "s3" {
bucket = "tf-state-company"
key = "prod/network.tfstate"
region = "me-central-1"
use_lockfile = true
}
}Remote state in S3 with state locking enabled.
Helpful resource: Terraform state documentation
4Step 4: Modules and code structure
Organise code for real teams.
What is it?
Modules package Terraform code into reusable building blocks. This step covers writing modules, using registry modules and structuring repositories.
What to learn
Start with a flat project. Only extract a module when you find yourself copying code.
Learn each topic here
Modules
Reusable groups of resources with inputs and outputs.
Public registry modules
Well-tested community modules, and checking their quality before use.
Loops and conditionals
count, for_each, dynamic blocks and conditional expressions.
Why it matters: for_each is used everywhere in real codebases.
Repository structure
Separating environments and components to keep changes small and safe.
Versioning
Pinning provider and module versions to avoid surprise changes.
Example
hcl
module "web_bucket" {
source = "./modules/static-site"
for_each = toset(["dev", "prod"])
name = "site-${each.key}"
}Uses one module twice, for dev and prod, with for_each.
Helpful resource: Terraform modules documentation
5Step 5: CI/CD, testing and team workflows
Run Terraform safely as a team.
What is it?
In real companies Terraform runs through pipelines with reviews and checks. This step covers automation, testing and policy.
What to learn
Post the terraform plan output on every pull request so reviewers can see exactly what will change.
Learn each topic here
Terraform in pipelines
Running plan on pull requests and apply after approval in GitHub Actions or GitLab CI.
Formatting and linting
terraform fmt, validate and tools like TFLint.
Testing
terraform test and tools like Terratest to check modules work as expected.
Security scanning
Checkov, Trivy or similar tools to catch insecure settings before deploy.
Why it matters: Catching an open storage bucket in review is far better than in production.
Policy as code
Sentinel or OPA rules that block changes breaking company standards.
Example
yaml
- run: terraform fmt -check
- run: terraform init -input=false
- run: terraform validate
- run: terraform plan -out=tfplan
- run: checkov -d .Common checks in a Terraform pull request pipeline.
Helpful resource: HCP Terraform documentation
6Step 6: Advanced Terraform and certification
Handle real-world complexity.
What is it?
The last step covers importing existing resources, refactoring, drift, multi-cloud patterns and the certification exam.
What to learn
Practise importing resources that were created by hand. Most companies have plenty of them.
Learn each topic here
Importing existing resources
Bringing manually created infrastructure under Terraform control with import blocks.
Refactoring with moved blocks
Renaming and reorganising resources without destroying them.
Drift detection
Finding changes made outside Terraform and deciding how to fix them.
Multi-cloud and Kubernetes providers
Managing DNS, Kubernetes and SaaS tools alongside cloud resources.
Terraform Associate exam
HashiCorp’s certification covering core workflow, state, modules and HCP Terraform.
Why it matters: A common requirement in DevOps job listings.
Example
hcl
import {
to = aws_s3_bucket.legacy
id = "old-manual-bucket"
}
resource "aws_s3_bucket" "legacy" {
bucket = "old-manual-bucket"
}Imports a bucket that was originally created by hand.
Helpful resource: Terraform Associate certification
Terraform roadmap project ideas
Terraform projects should be reproducible. Anyone should be able to clone your repo, set credentials and run apply successfully.
Static website infrastructure
Bucket, CDN and DNS created with Terraform.
Single VM with networking
A VM, firewall rules and outputs.
Multi-environment setup
Dev and prod with modules, tfvars and remote state.
Kubernetes cluster
A managed Kubernetes cluster and node pool as code.
Terraform CI/CD
Plans on PRs, security scans and approved applies.
Legacy import project
Import, refactor and document a hand-built environment.
Tips to finish this terraform roadmap
- Read every plan. The plan tells you what will be destroyed. Never skip it.
- Protect your state. Use remote backends with locking and restrict who can access them.
- Keep changes small. Small, frequent applies are much safer than big ones.
- Learn one cloud well. Terraform is easier when you understand the services you’re creating.
Career paths and next steps
Terraform is a core DevOps skill. Continue with the DevOps Engineer and Kubernetes roadmaps.
Pair it with a cloud roadmap such as AWS, Azure or Google Cloud, and later the Site Reliability Engineer or Cloud Security roadmap.
Related roadmaps
Terraform Roadmap FAQs
Is Terraform hard to learn?
The basics are approachable in a few weeks. State management, modules and team workflows take longer to master.
Do I need programming skills for Terraform?
Not much. HCL is simpler than a programming language, but basic scripting and Git knowledge help.
Terraform or OpenTofu?
OpenTofu is an open-source fork with very similar syntax. Learning Terraform covers almost everything you need for both.
Is the Terraform Associate certification worth it?
Yes for job seekers. It’s affordable, widely recognised and shows you understand the core concepts.