Skip to main content
Navigation
HomeTechnical ReferenceJournalGitHubGitHub
Sidebar — toggle document categories via the logo
Categories

Terraform

Infrastructure-as-code patterns and reference material for Terraform.

Terraform Overview

High-level overview of Terraform plus common commands, state operations, and workspace reference tables.

Terraform Getting Started

Quick-start guide for Terraform: the "Hello, World" equivalent, core workflow, and first EC2 deployment with terraform init, plan, apply, and destroy.

Why Terraform — Infrastructure as Code

Why Terraform over click-ops, manual scripts, or other IaC tools, plus declarative configuration patterns and bootstrapping a web server with user_data.

Terraform Configuration Syntax

Terraform HCL syntax deep-dive: resources, variables, outputs, data sources, security groups, auto-scaling, and load balancers with complete examples.

Managing Terraform State

Terraform state management: remote backends (S3), state locking (DynamoDB), workspace isolation, remote state data sources, and file layout strategies.

Terraform Modules

Building reusable Terraform modules: inputs, outputs, module sources (local, Git), file layout conventions, versioning, and composing infrastructure from modules.

Loops, Conditionals & Deployments

Terraform patterns for loops, conditionals, dynamic blocks, zero-downtime deployment strategies, and the moved block for safe refactoring.

Terraform Secrets Management

Strategies for managing secrets with Terraform: KMS encryption, AWS Secrets Manager, IAM roles, OIDC federation, and keeping secrets out of state files.

Working with Multiple Providers

Using multiple AWS regions, multiple AWS accounts (via IAM assume_role), and combining AWS + Kubernetes providers in a single Terraform configuration.

Production-Grade Terraform Infrastructure

Building production-grade Terraform: small modules, precondition/postcondition validation, provisioners, null_resource, and external data sources.

Testing Terraform Code

Testing infrastructure code with Terratest: unit tests via plan validation, integration tests, end-to-end tests, OPA policy validation, and staged test patterns.

Terraform Team Collaboration

Working with Terraform as a team: Terragrunt for DRY configurations, CI/CD pipelines, code review workflows, environment isolation, and how to avoid common team pitfalls.