This hands-on tutorial takes you from Terraform basics to advanced features through a progressive project-based approach using real AWS infrastructure. All examples use AWS Free Tier services to avoid costs.
- AWS Account (Free Tier)
- Create at: https://aws.amazon.com/free/
- See AWS_SETUP.md for complete setup guide
- AWS CLI installed and configured
- Download from: https://aws.amazon.com/cli/
- Verify:
aws --version - Configure:
aws configure
- Terraform installed (version 1.0+)
- Download from: https://www.terraform.io/downloads
- Verify:
terraform version
- Text Editor (VS Code recommended with Terraform extension)
- Basic command-line knowledge
Warning
Before starting the tutorial:
- β Complete AWS_SETUP.md - Set up AWS account and credentials
- β Set up billing alerts (1,γγ« 5,γγ« 10γγ« thresholds)
- β
Verify
aws sts get-caller-identityworks - β Read CLEANUP.md - Understand resource cleanup
Project: AWS Storage and Identity Management
- Introduction to Terraform and IaC concepts
- AWS provider configuration
- S3 buckets and IAM resources
- Variables and outputs
- Terraform workflow: init, plan, apply, destroy
AWS Services: S3, IAM, SSM Parameter Store
π Location: module-1-basics/
Project: VPC and EC2 Web Server
- VPC networking (subnets, route tables, IGW)
- EC2 instance deployment (t2.micro free tier)
- Security groups and network ACLs
- Creating reusable VPC modules
- Count and for_each meta-arguments
AWS Services: VPC, EC2, Security Groups
π Location: module-2-intermediate/
Project: Multi-Environment Serverless Application
- Workspaces for environment management
- Remote state with S3 backend
- DynamoDB state locking
- Lambda function deployment
- Best practices and production patterns
AWS Services: Lambda, S3 (state), DynamoDB, CloudWatch
π Location: module-3-advanced/
-
Complete AWS Setup
# Follow AWS_SETUP.md first! # Verify AWS credentials aws sts get-caller-identity
-
Navigate to tutorial directory
cd terraform-recap -
Start with Module 1
cd module-1-basics cat README.md
Each module contains:
README.md- Theory and instructionsexercises/- Hands-on challengessolutions/- Reference implementationsproject/- Main project files
By the end of this tutorial, you will:
- β Understand Infrastructure as Code principles
- β Write Terraform configurations for AWS
- β Manage state with S3 and DynamoDB
- β Create reusable, modular infrastructure code
- β Implement multi-environment deployments
- β Deploy serverless applications with Lambda
- β Apply Terraform best practices
- β Debug and troubleshoot Terraform issues
All examples stay within AWS Free Tier limits:
- S3: <5GB storage, minimal requests
- EC2: t2.micro instances, <750 hours/month
- Lambda: <1M requests/month
- DynamoDB: <25GB storage
- VPC, IAM, CloudWatch: Always free
Caution
To avoid charges:
- β Set up billing alerts BEFORE starting
- β
Run
terraform destroyafter EACH module - β Verify resource deletion in AWS Console
- β Don't leave instances running overnight
- β Check billing dashboard daily
See CLEANUP.md for detailed cleanup instructions.
# Verify credentials aws sts get-caller-identity # Reconfigure if needed aws configure
# Reinitialize
rm -rf .terraform
terraform init# Verify region aws configure get region # Should be: us-east-1 (or your chosen region)
- Run
terraform destroyimmediately - Check AWS Billing Dashboard
- Review CLEANUP.md
- Contact AWS Support (free for billing issues)
- Explore More AWS Services: RDS, ECS, EKS
- Learn Terraform Cloud: Team collaboration features
- Study CI/CD Integration: Automate deployments
- Practice Advanced Patterns: Multi-region, disaster recovery
- Join the Community: HashiCorp forums, AWS communities
- π Never commit AWS credentials to Git
- π° Always destroy resources after learning
- π Monitor billing dashboard regularly
- π§Ή Follow cleanup procedures carefully
- π Use IAM users, not root account
Ready to start?
- Complete AWS_SETUP.md
- Head to
module-1-basics/and begin your Terraform journey! π