Comprehensive hands-on Infrastructure as Code labs covering AWS, GCP, and Azure. These labs are designed to take you from beginner to advanced levels with production-ready examples and best practices.
This workshop provides practical, hands-on experience with Infrastructure as Code using Terraform across the three major cloud providers. Each lab is self-contained with clear objectives, instructions, and solutions.
- Prerequisites
- Quick Start
- Lab Structure
- AWS Labs
- GCP Labs
- Azure Labs
- Best Practices
- Contributing
- Troubleshooting
- Terraform >= 1.0 (Install Guide)
- Git (Install Guide)
- Code Editor (VS Code, IntelliJ, etc.)
- AWS Account with IAM user/role (AWS Free Tier)
- GCP Account with project (GCP Free Tier)
- Azure Account with subscription (Azure Free Account)
- AWS CLI (Install Guide)
- gcloud CLI (Install Guide)
- Azure CLI (Install Guide)
-
Clone the repository
git clone https://github.com/UNC-GDSC/Terraform-Workshop-Labs.git cd Terraform-Workshop-Labs -
Choose your cloud provider and lab
cd aws/labs/01-beginner/lab1-first-ec2 # or cd gcp/labs/01-beginner/lab1-first-vm # or cd azure/labs/01-beginner/lab1-first-vm
-
Follow the lab README
cat README.md
-
Initialize and apply
terraform init terraform plan terraform apply
-
Clean up resources
terraform destroy
Each cloud provider follows a consistent structure:
{cloud-provider}/
βββ labs/
β βββ 01-beginner/ # Foundational concepts
β βββ 02-intermediate/ # Real-world scenarios
β βββ 03-advanced/ # Complex architectures
βββ modules/ # Reusable Terraform modules
βββ examples/ # Quick reference examples
βββ README.md # Provider-specific guide
Each lab contains:
README.md- Lab objectives, instructions, and learning outcomesmain.tf- Main Terraform configurationvariables.tf- Input variablesoutputs.tf- Output valuesterraform.tfvars.example- Example variable valuessolution/- Complete working solution (optional)
- First EC2 Instance - Deploy your first virtual machine
- S3 Static Website - Host a static website on S3
- VPC Basics - Create a custom VPC with subnets
- RDS Database - Deploy a managed database
- IAM Users & Policies - Manage users and permissions
- Multi-Tier Web App - Load balancer, EC2, and RDS
- Auto Scaling Group - Dynamic scaling based on load
- Lambda & API Gateway - Serverless REST API
- ECS Fargate - Containerized application
- CloudFront CDN - Global content delivery
- Multi-Region Architecture - High availability across regions
- EKS Cluster - Kubernetes on AWS
- CI/CD Pipeline - CodePipeline with infrastructure deployment
- Secure Enterprise VPC - Transit Gateway, VPN, and PrivateLink
- Disaster Recovery - Automated backup and recovery
- First Compute Instance - Deploy your first VM
- Cloud Storage Website - Host a static website
- VPC Network - Create custom networks
- Cloud SQL - Managed PostgreSQL database
- IAM & Service Accounts - Access management
- Load Balanced Web App - GCE with load balancing
- Cloud Run - Serverless containers
- Cloud Functions - Event-driven functions
- GKE Autopilot - Managed Kubernetes cluster
- Cloud CDN - Content delivery network
- Multi-Region Setup - Global load balancing
- GKE Production Cluster - Production-ready Kubernetes
- Cloud Build CI/CD - Automated deployment pipeline
- Shared VPC - Enterprise network architecture
- High Availability - Multi-zone, multi-region setup
- First Virtual Machine - Deploy your first VM
- Storage Account Website - Static website hosting
- Virtual Network - Create VNet and subnets
- Azure SQL Database - Managed database service
- RBAC & Managed Identities - Access control
- App Service Web App - PaaS web application
- VM Scale Sets - Auto-scaling VMs
- Azure Functions - Serverless compute
- AKS Cluster - Managed Kubernetes
- Front Door - Global routing and CDN
- Hub-Spoke Topology - Enterprise network design
- AKS Production Cluster - Production Kubernetes setup
- Azure DevOps Pipeline - Infrastructure CI/CD
- Multi-Region Active-Active - Global high availability
- Landing Zone - Enterprise-scale architecture
All labs follow infrastructure as code best practices:
- β Modular Design - Reusable, composable modules
- β Version Control - All infrastructure as code
- β State Management - Remote state with locking
- β Security First - Least privilege, encryption, secrets management
- β Documentation - Clear, comprehensive docs
- β Cost Optimization - Right-sizing and tagging
- β Testing - Validation and automated testing
- β CI/CD Integration - Automated deployment pipelines
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-lab) - Make your changes
- Test thoroughly
- Submit a pull request
Authentication Errors
- Ensure cloud CLI is configured correctly
- Check credentials and permissions
- Verify environment variables
Resource Limits
- Check cloud provider quotas
- Use smaller instance types for labs
- Clean up unused resources
State Lock Issues
- Ensure only one Terraform operation runs at a time
- Use remote state with locking for teams
Version Conflicts
- Use consistent Terraform versions
- Check provider version constraints
- π Check lab-specific README files
- π Search Issues
- π¬ Ask questions in Discussions
- π Report bugs via Issues
This project is licensed under the MIT License - see the LICENSE file for details.
- HashiCorp Terraform Team
- AWS, GCP, and Azure communities
- All contributors to this project
Happy Learning! π