Discover / Terraform and infrastructure as code / Reading path

Learn Terraform and infrastructure as code: books in order

@codesherpaIntermediate → Expert
7
Books
59
Hours
4
Stages
Not yet rated

This curriculum takes an intermediate learner from Terraform and IaC fundamentals through advanced module design, multi-cloud patterns, and production-grade CI/CD pipelines. Each stage builds directly on the last — establishing core vocabulary first, then deepening Terraform-specific mastery, then broadening into enterprise-scale IaC practices and automation.

1

IaC Foundations & Terraform Core

Intermediate

Understand the philosophy of Infrastructure as Code, learn Terraform's core primitives (providers, resources, state, variables, outputs), and write your first real configurations with confidence.

Study plan for this stage

Pace: 6–8 weeks, ~40–50 pages/day (mix of reading and hands-on practice)

Key concepts
  • Infrastructure as Code philosophy: treating infrastructure as software with version control, testing, and automation
  • Terraform's core primitives: providers, resources, data sources, variables, outputs, and locals
  • State management: understanding Terraform state files, remote state, and state locking for team collaboration
  • Configuration language fundamentals: HCL syntax, resource dependencies, interpolation, and meta-arguments (count, for_each, depends_on)
  • Modules and code organization: structuring Terraform code for reusability, maintainability, and scalability
  • Immutable infrastructure patterns: why and how to replace rather than modify infrastructure
  • Change management and planning: using terraform plan, terraform apply, and understanding drift detection
  • Testing and validation strategies: validating configurations, linting, and basic testing approaches for IaC
You should be able to answer
  • What are the core benefits of Infrastructure as Code, and how does Terraform embody the IaC philosophy?
  • Explain the relationship between providers, resources, and data sources in Terraform. How do they work together?
  • What is Terraform state, why is it critical, and what are the risks of managing state in a team environment?
  • How do variables, outputs, and locals differ, and when should you use each in your configurations?
  • What is the difference between mutable and immutable infrastructure, and why does Terraform favor immutability?
  • How do modules improve code organization, and what constitutes a well-designed module?
  • What is the terraform plan output telling you, and how should you interpret it before applying changes?
Practice
  • Set up a local Terraform project with a provider (AWS, Azure, or GCP) and create 3–5 basic resources (e.g., VPC, subnet, security group); run terraform plan and terraform apply to see state creation
  • Refactor a single Terraform file into a modular structure with separate files for variables, outputs, and resources; verify the configuration still works
  • Create a reusable module (e.g., for an EC2 instance or storage bucket) with input variables and outputs; use it in a root configuration to instantiate multiple instances
  • Set up remote state using a backend (S3 with DynamoDB for locking, or Terraform Cloud); migrate from local state and verify team members can access the same state
  • Write a Terraform configuration using count or for_each to create multiple similar resources; modify the count/for_each logic and observe how terraform plan reflects the changes
  • Introduce a deliberate infrastructure drift (manually change a resource in the cloud console), run terraform plan to detect it, and fix it with Terraform
  • Create a configuration with explicit dependencies using depends_on and implicit dependencies via resource references; document why each dependency exists
  • Write input variables with validation rules and sensible defaults; create a terraform.tfvars file and a separate variables file to manage different environments (dev/prod)

Next up: This stage equips you with Terraform's foundational building blocks and the mindset to treat infrastructure as code; the next stage will deepen your expertise in advanced patterns (workspaces, complex module hierarchies, testing frameworks, and CI/CD integration) and production-grade practices.

Terraform : Up & Running
Yevgeniy Brikman · 2017 · 287 pp

The single most widely-read Terraform book — it covers providers, state, workspaces, and modules from first principles with real AWS examples. Start here to build the vocabulary every later book assumes.

Infrastructure As Code
Kief Morris · 2021 · 393 pp

Provides the vendor-neutral mental model behind IaC — patterns, principles, and pitfalls — that makes Terraform decisions feel principled rather than arbitrary. Read it immediately after Brikman to understand *why* Terraform works the way it does.

2

Terraform In Depth — State, Modules & Patterns

Intermediate

Master remote state management, module composition, dependency graphs, and reusable module design patterns for real-world, multi-environment infrastructures.

Study plan for this stage

Pace: 6–8 weeks, ~40–50 pages/day with hands-on labs

Key concepts
  • Remote state management (S3, Terraform Cloud, Consul) and state locking to prevent concurrent modifications
  • Module composition, input variables, outputs, and local values for building reusable infrastructure components
  • Dependency graphs, implicit/explicit dependencies, and resource targeting for managing complex infrastructure
  • Module design patterns: root modules, child modules, registry modules, and versioning strategies
  • Multi-environment infrastructure using workspaces, module instantiation, and environment-specific variable files
  • State file structure, state migration, and recovery strategies for production systems
  • Terraform workflows in teams: remote backends, state locking, and collaborative best practices
  • Common pitfalls: circular dependencies, module anti-patterns, and debugging state/module issues
You should be able to answer
  • How does remote state management improve team collaboration, and what are the trade-offs between different backend options (S3, Terraform Cloud, Consul)?
  • Explain the difference between implicit and explicit dependencies in Terraform, and how you would use depends_on to control resource ordering.
  • Design a reusable module structure for a multi-environment application (dev, staging, prod). What variables and outputs would you expose?
  • What is the purpose of state locking, and how would you troubleshoot a stuck lock in a production environment?
  • How would you organize a Terraform project with multiple modules to avoid circular dependencies and maintain clarity in the dependency graph?
  • Describe a strategy for migrating state from local to remote, and what precautions you would take to avoid data loss.
Practice
  • Set up a remote backend using S3 with state locking (DynamoDB) and migrate a local state file to it; verify state consistency.
  • Create a reusable VPC module with configurable CIDR blocks, subnets, and NAT gateways; instantiate it twice for different environments.
  • Build a child module for an RDS database that accepts engine type, instance class, and backup retention as inputs; expose the endpoint as an output.
  • Design a root module that composes 3+ child modules (networking, compute, database) and explicitly define dependencies using depends_on where needed.
  • Implement a multi-environment setup using workspaces or separate variable files (terraform.dev.tfvars, terraform.prod.tfvars) and deploy to both.
  • Intentionally create a circular dependency between two modules, identify it using terraform graph, and refactor to resolve it.
  • Use terraform state commands (list, show, rm, mv) to inspect, modify, and recover from a corrupted state scenario in a lab environment.

Next up: This stage equips you with the architectural patterns and operational practices needed to manage Terraform at scale; the next stage will focus on testing, CI/CD integration, and production hardening to ensure reliability and safety in automated infrastructure deployments.

Terraform Cookbook
Mikael Krief · 2020 · 634 pp

A recipe-driven deep dive into state backends, workspaces, module registries, and provider configuration — fills the practical gaps left after the foundational books with concrete, copy-adaptable patterns.

Terraform in Action
Scott Winkler · 2021 · 408 pp

Walks through building a production-grade system end-to-end, reinforcing module design, data sources, and dependency management with a narrative project that mirrors real engineering work.

3

Cloud Platforms, Providers & Multi-Cloud

Intermediate

Apply Terraform fluently across AWS, Azure, and GCP provider ecosystems, understand provider versioning and locking, and design infrastructure that spans or migrates between clouds.

Study plan for this stage

Pace: 4–5 weeks, ~40–50 pages/day

Key concepts
  • Cloud provider abstraction patterns and how Terraform normalizes AWS, Azure, and GCP APIs
  • Provider configuration, authentication, and versioning constraints (required_providers, version pinning)
  • Multi-cloud architecture patterns: federation, hybrid, and cloud-agnostic design principles
  • State management across cloud providers and remote state locking strategies
  • Infrastructure patterns for cloud-native applications: immutable infrastructure, declarative configuration, and dynamic resource provisioning
  • Provider-specific resource mapping and how to translate cloud services into Terraform modules
  • Migration strategies between cloud platforms using Terraform as the abstraction layer
You should be able to answer
  • How does Terraform abstract differences between AWS, Azure, and GCP provider APIs, and what are the limitations of this abstraction?
  • What is the purpose of required_providers and version constraints, and how do you lock provider versions across team environments?
  • What are the key architectural patterns for multi-cloud infrastructure (federation, hybrid, cloud-agnostic), and when should you use each?
  • How does remote state locking work across cloud providers, and what are the risks of state management in a multi-cloud setup?
  • What is immutable infrastructure, and how does Terraform enable this pattern across different cloud platforms?
  • How would you design a Terraform module that works across AWS, Azure, and GCP, and what trade-offs exist?
Practice
  • Set up Terraform projects for AWS, Azure, and GCP with proper provider configuration, authentication, and version constraints; document the differences in setup
  • Create a multi-cloud state backend using remote state (S3, Azure Blob Storage, or GCS) with state locking enabled; test concurrent operations
  • Build a reusable Terraform module for a common workload (e.g., web server + database) and deploy it to at least two different cloud providers, documenting provider-specific differences
  • Design and implement a cloud migration scenario: provision infrastructure on one cloud (e.g., AWS), then migrate to another (e.g., Azure) using Terraform state manipulation and refactoring
  • Create a hybrid cloud architecture using Terraform that spans two providers (e.g., AWS + Azure), including networking, authentication, and data flow between them
  • Implement provider-agnostic infrastructure patterns: write a Terraform module using variables and locals to minimize provider-specific logic, then instantiate it across multiple clouds
  • Set up a multi-cloud disaster recovery scenario where infrastructure can be provisioned in a secondary cloud using the same Terraform code with minimal changes

Next up: This stage equips you with the fluency to design and manage infrastructure across multiple cloud ecosystems using Terraform as a unified abstraction layer, preparing you to tackle advanced topics like infrastructure automation at scale, CI/CD integration, and policy-as-code frameworks.

Cloud Native Infrastructure: Patterns for Scalable Infrastructure and Applications in a Dynamic Environment
Justin Garrison · 2017 · 160 pp

Broadens the perspective to cloud-native design principles — networking, security, and scalability — giving the architectural context needed to make sound multi-cloud Terraform decisions.

4

Testing, CI/CD & Production Automation

Expert

Integrate Terraform into automated pipelines, write infrastructure tests, enforce policy as code, and operate IaC safely at scale with GitOps and CI/CD workflows.

Study plan for this stage

Pace: 6–8 weeks, ~40–50 pages/day (alternating between both books in parallel, with 2–3 days per week dedicated to hands-on exercises)

Key concepts
  • CI/CD pipeline architecture and how to integrate Terraform into automated deployment workflows
  • Infrastructure testing strategies: unit tests, integration tests, and compliance validation for IaC
  • Policy as Code (PaC) enforcement using tools like Sentinel, OPA, or Checkov to prevent misconfiguration
  • GitOps principles: version control as the single source of truth, declarative infrastructure, and automated reconciliation
  • Deployment safety patterns: blue-green deployments, canary releases, and rollback strategies with Terraform
  • Measuring and optimizing deployment frequency, lead time, and change failure rate as organizational metrics
  • Scaling Terraform across teams: state management, remote backends, and collaboration workflows
  • Observability and feedback loops in automated infrastructure pipelines
You should be able to answer
  • How do you structure a CI/CD pipeline to safely apply Terraform changes, and what gates should exist before production?
  • What are the differences between unit testing, integration testing, and compliance testing for infrastructure code, and which tools would you use for each?
  • How does Policy as Code prevent infrastructure drift and enforce organizational standards, and what are common policy violations you should catch?
  • Explain the GitOps workflow: how does version control become the source of truth, and how does continuous reconciliation work?
  • What deployment patterns minimize risk when rolling out infrastructure changes, and how do you handle rollbacks?
  • How do deployment frequency, lead time for changes, and change failure rate relate to organizational performance, and how do you measure them?
Practice
  • Build a complete CI/CD pipeline (using GitHub Actions, GitLab CI, or Jenkins) that validates, plans, and applies Terraform configurations with approval gates before production
  • Write unit tests for Terraform modules using Terratest or tftest, covering variable validation, output correctness, and resource creation
  • Implement a Policy as Code ruleset (using Sentinel, OPA, or Checkov) that enforces tagging standards, security group restrictions, and cost controls
  • Set up a GitOps workflow using ArgoCD or Flux where Terraform configurations in Git automatically reconcile with live infrastructure
  • Design and execute a blue-green deployment of a multi-tier application using Terraform, including traffic switching and rollback procedures
  • Create an integration test suite that validates infrastructure behavior post-deployment (e.g., security group rules, DNS resolution, application connectivity)
  • Instrument a Terraform pipeline with metrics collection: measure and chart deployment frequency, lead time, and change failure rate over 2–4 weeks

Next up: This stage equips you with the operational discipline and automation frameworks to deploy and govern Terraform at organizational scale; the next stage will likely focus on advanced multi-cloud strategies, cost optimization, and enterprise governance patterns that depend on these solid CI/CD and testing foundations.

DevOps for the Desperate
Bradley Smith · 2022 · 176 pp

Grounds CI/CD and automation concepts in practical Linux and pipeline fundamentals, ensuring the learner can wire Terraform into real deployment workflows without gaps in toolchain knowledge.

Accelerate
Nicole Forsgren · 2018 · 288 pp

The research-backed case for the delivery practices — trunk-based development, automated testing, deployment frequency — that justify and shape how mature teams run Terraform in CI/CD. Read last to frame everything learned as part of a high-performing engineering culture.

Discussion

Keep reading

Paths that share books, cover the same subject, or open a related topic.

Shares 2 books

Learn DevOps: ship software that stays up

Intermediate10books92 hrs5 stages
Shares 1 book

Learn cloud computing: from servers to serverless

Beginner9books87 hrs4 stages
Shares 1 book

Software engineering: the best books to read in order

Beginner10books92 hrs4 stages
More on Kafka and event streaming

Learn Apache Kafka: the best books in order

Beginner6books60 hrs5 stages
More on Apache Spark and big data

Learn Apache Spark: the best books to read in order

Beginner8books90 hrs5 stages
More on Power BI for business analytics

Learn Power BI: the best books in order

Beginner7books64 hrs4 stages