Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

Terraform Practical Learning Session (2-3 Hours)

🎯 Overview

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.

πŸ“‹ Prerequisites

Required

Important Setup Steps

Warning

Before starting the tutorial:

  1. βœ… Complete AWS_SETUP.md - Set up AWS account and credentials
  2. βœ… Set up billing alerts (1,ドル 5,ドル 10ドル thresholds)
  3. βœ… Verify aws sts get-caller-identity works
  4. βœ… Read CLEANUP.md - Understand resource cleanup

πŸ—‚οΈ Tutorial Structure

Module 1: Terraform Basics (45 minutes)

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/

Module 2: Intermediate Concepts (60 minutes)

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/

Module 3: Advanced Features (45 minutes)

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/

πŸš€ Quick Start

  1. Complete AWS Setup

    # Follow AWS_SETUP.md first!
    # Verify AWS credentials
    aws sts get-caller-identity
  2. Navigate to tutorial directory

    cd terraform-recap
  3. Start with Module 1

    cd module-1-basics
    cat README.md

πŸ“š Learning Path

Each module contains:

  • README.md - Theory and instructions
  • exercises/ - Hands-on challenges
  • solutions/ - Reference implementations
  • project/ - Main project files

πŸŽ“ Learning Objectives

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

πŸ’° Cost Management

Free Tier Services Used

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

Cost Safety Measures

Caution

To avoid charges:

  • βœ… Set up billing alerts BEFORE starting
  • βœ… Run terraform destroy after 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.

πŸ†˜ Troubleshooting

AWS Credentials Issues

# Verify credentials
aws sts get-caller-identity
# Reconfigure if needed
aws configure

Terraform Provider Errors

# Reinitialize
rm -rf .terraform
terraform init

Region Issues

# Verify region
aws configure get region
# Should be: us-east-1 (or your chosen region)

Unexpected Costs

  1. Run terraform destroy immediately
  2. Check AWS Billing Dashboard
  3. Review CLEANUP.md
  4. Contact AWS Support (free for billing issues)

πŸ“– Additional Resources

🎯 Next Steps After Tutorial

  1. Explore More AWS Services: RDS, ECS, EKS
  2. Learn Terraform Cloud: Team collaboration features
  3. Study CI/CD Integration: Automate deployments
  4. Practice Advanced Patterns: Multi-region, disaster recovery
  5. Join the Community: HashiCorp forums, AWS communities

⚠️ Important Reminders

  • πŸ”’ 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?

  1. Complete AWS_SETUP.md
  2. Head to module-1-basics/ and begin your Terraform journey! πŸš€

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /