Skip to main content

Getting Started with Terraform

Welcome to Terraform

Right now, your AWS infrastructure probably lives in the console — things you clicked through to set up. That's fine for learning, but it means:

  • There's no record of what you created or why
  • Recreating the setup (for staging, for disaster recovery) requires doing it all again manually
  • Team members can't review or propose changes to infrastructure

Terraform (by HashiCorp) solves this with Infrastructure as Code (IaC). You describe what you want — EC2 instances, RDS databases, security groups, S3 buckets — in .tf files, and Terraform creates, updates, or destroys the real resources to match.

terraform init # download providers
terraform plan # preview what will change
terraform apply # make it happen

What You'll Learn

  • HCL syntax — Terraform's human-readable configuration language
  • Providers — plugins for AWS, GCP, Azure, Cloudflare, and more
  • Resources — declaring infrastructure (EC2, RDS, S3, security groups)
  • Variables and outputs — making configs reusable across environments
  • State — how Terraform tracks what it created, and why remote state matters
  • Modules — packaging reusable infrastructure components
  • The plan/apply workflow — safe, reviewable infrastructure changes
  • Destroying infrastructureterraform destroy for clean teardowns

Prerequisites

  • An AWS account with IAM credentials configured (aws configure)
  • Terraform CLI installed
  • Basic understanding of AWS services (EC2, S3, VPC)