🏗️ Terraform

Learn Terraform from beginner to advanced with hands-on examples: a local first project, HCL, variables, providers, AWS resources, dependencies, loops, modules, remote state and locking, environment isolation, imports and refactoring, testing, secrets, CI/CD, troubleshooting, and a production capstone.

16 lessons · about 0.6 hours

Start the first lesson →
  1. 01Terraform: Start Here Understand infrastructure as code, the plan/apply workflow, and the learning path from local experiments to team operations.Beginner2 min read
  2. 02Your First Terraform Project Install Terraform and create, change, inspect, and destroy a local file without using a cloud account.Beginner2 min read
  3. 03HCL, Resource Addresses, and Project Layout Read Terraform blocks, expressions, references, and version constraints, and organize a root module clearly.Beginner2 min read
  4. 04Variables, Locals, Outputs, and Validation Build a configurable local lab with typed inputs, useful outputs, and clear validation errors.Beginner2 min read
  5. 05Providers and Your First AWS Resources Configure AWS safely and provision a private, versioned S3 bucket with explicit resource settings.Beginner2 min read
  6. 06Dependencies, Data Sources, and Resource Lifecycle Understand the dependency graph, read existing infrastructure, and reason about replacements and lifecycle safeguards.Intermediate2 min read
  7. 07Count, for_each, Functions, and Stable Identities Create repeated resources with predictable addresses and avoid accidental changes caused by list indexes.Intermediate2 min read
  8. 08Reusable Modules and Clear Interfaces Build and call a small module, expose outputs, and define sensible module ownership and versioning.Intermediate2 min read
  9. 09State, Remote Backends, and Locking Share state through S3, enable native locking, migrate safely, and protect recovery data.Intermediate2 min read
  10. 10Environments, Workspaces, and Multiple Accounts Separate development and production ownership, understand workspace limits, and configure provider aliases.Intermediate2 min read
  11. 11Imports, Moved Blocks, and Safe Refactoring Adopt existing infrastructure, rename resources without recreating them, and remove ownership deliberately.Advanced2 min read
  12. 12Testing, Preconditions, and Policy Checks Use validation, lifecycle conditions, Terraform tests, and policy checks to catch different classes of errors.Advanced2 min read
  13. 13Secrets, Ephemeral Values, and Least Privilege Protect credentials and state, distinguish sensitive from ephemeral values, and use provider-supported write-only inputs.Advanced3 min read
  14. 14CI/CD and Reviewed Production Changes Design an automated plan and apply workflow with protected credentials, saved plans, serialization, and drift checks.Advanced2 min read
  15. 15Drift, Troubleshooting, and Disaster Recovery Diagnose common failures, recover after partial applies, and operate state without destructive guesswork.Advanced3 min read
  16. 16Production Capstone and Interview Practice Combine modules, isolated environments, remote state, tests, and reviewed delivery in a production-style storage project.Advanced4 min read