Skip to content

UNC-GDSC/Terraform-Workshop-Labs

Repository files navigation

Infrastructure as Code (IaC) Workshop Labs

License: MIT Terraform AWS GCP Azure

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.

🎯 Overview

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.

πŸ“š Table of Contents

πŸ”§ Prerequisites

Required Tools

Cloud Provider Accounts

Cloud CLIs (Optional but Recommended)

πŸš€ Quick Start

  1. Clone the repository

    git clone https://github.com/UNC-GDSC/Terraform-Workshop-Labs.git
    cd Terraform-Workshop-Labs
  2. 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
  3. Follow the lab README

    cat README.md
  4. Initialize and apply

    terraform init
    terraform plan
    terraform apply
  5. Clean up resources

    terraform destroy

πŸ“ Lab Structure

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 outcomes
  • main.tf - Main Terraform configuration
  • variables.tf - Input variables
  • outputs.tf - Output values
  • terraform.tfvars.example - Example variable values
  • solution/ - Complete working solution (optional)

☁️ AWS Labs

Beginner Level

  1. First EC2 Instance - Deploy your first virtual machine
  2. S3 Static Website - Host a static website on S3
  3. VPC Basics - Create a custom VPC with subnets
  4. RDS Database - Deploy a managed database
  5. IAM Users & Policies - Manage users and permissions

Intermediate Level

  1. Multi-Tier Web App - Load balancer, EC2, and RDS
  2. Auto Scaling Group - Dynamic scaling based on load
  3. Lambda & API Gateway - Serverless REST API
  4. ECS Fargate - Containerized application
  5. CloudFront CDN - Global content delivery

Advanced Level

  1. Multi-Region Architecture - High availability across regions
  2. EKS Cluster - Kubernetes on AWS
  3. CI/CD Pipeline - CodePipeline with infrastructure deployment
  4. Secure Enterprise VPC - Transit Gateway, VPN, and PrivateLink
  5. Disaster Recovery - Automated backup and recovery

➑️ View AWS Labs

☁️ GCP Labs

Beginner Level

  1. First Compute Instance - Deploy your first VM
  2. Cloud Storage Website - Host a static website
  3. VPC Network - Create custom networks
  4. Cloud SQL - Managed PostgreSQL database
  5. IAM & Service Accounts - Access management

Intermediate Level

  1. Load Balanced Web App - GCE with load balancing
  2. Cloud Run - Serverless containers
  3. Cloud Functions - Event-driven functions
  4. GKE Autopilot - Managed Kubernetes cluster
  5. Cloud CDN - Content delivery network

Advanced Level

  1. Multi-Region Setup - Global load balancing
  2. GKE Production Cluster - Production-ready Kubernetes
  3. Cloud Build CI/CD - Automated deployment pipeline
  4. Shared VPC - Enterprise network architecture
  5. High Availability - Multi-zone, multi-region setup

➑️ View GCP Labs

☁️ Azure Labs

Beginner Level

  1. First Virtual Machine - Deploy your first VM
  2. Storage Account Website - Static website hosting
  3. Virtual Network - Create VNet and subnets
  4. Azure SQL Database - Managed database service
  5. RBAC & Managed Identities - Access control

Intermediate Level

  1. App Service Web App - PaaS web application
  2. VM Scale Sets - Auto-scaling VMs
  3. Azure Functions - Serverless compute
  4. AKS Cluster - Managed Kubernetes
  5. Front Door - Global routing and CDN

Advanced Level

  1. Hub-Spoke Topology - Enterprise network design
  2. AKS Production Cluster - Production Kubernetes setup
  3. Azure DevOps Pipeline - Infrastructure CI/CD
  4. Multi-Region Active-Active - Global high availability
  5. Landing Zone - Enterprise-scale architecture

➑️ View Azure Labs

πŸ† Best Practices

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

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-lab)
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ› Troubleshooting

Common Issues

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

Getting Help

  • πŸ“– Check lab-specific README files
  • πŸ” Search Issues
  • πŸ’¬ Ask questions in Discussions
  • πŸ› Report bugs via Issues

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • HashiCorp Terraform Team
  • AWS, GCP, and Azure communities
  • All contributors to this project

πŸ”— Additional Resources


Happy Learning! πŸš€

About

Hands-on IaC labs for AWS / GCP / Azure

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •