AWS Auto-Scaling Infrastructure

CI/CD Status

Production-ready infrastructure with Terraform demonstrating AWS scaling patterns

                         ┌─────────────────────────────────────────────────────────┐
                         │                        VPC                               │
                         │  ┌─────────────────┐       ┌─────────────────┐          │
                         │  │  Public Subnet  │       │  Public Subnet  │          │
                         │  │     AZ-1a       │       │     AZ-1b       │          │
                         │  │   ┌───────┐     │       │   ┌───────┐     │          │
     Internet ──► ALB ──►│  │   │  EC2  │     │       │   │  EC2  │     │          │
                         │  │   └───────┘     │       │   └───────┘     │          │
                         │  └─────────────────┘       └─────────────────┘          │
                         │           │                         │                    │
                         │  ┌─────────────────┐       ┌─────────────────┐          │
                         │  │ Private Subnet  │       │ Private Subnet  │          │
                         │  │     AZ-1a       │       │     AZ-1b       │          │
                         │  │   ┌───────┐     │       │   ┌───────┐     │          │
                         │  │   │  RDS  │◄────┼───────┼───│  RDS  │     │          │
                         │  │   │Primary│     │       │   │Standby│     │          │
                         │  │   └───────┘     │       │   └───────┘     │          │
                         │  └─────────────────┘       └─────────────────┘          │
                         └─────────────────────────────────────────────────────────┘
            

🌐 VPC Module

  • Multi-AZ architecture
  • Public & private subnets
  • NAT Gateway
  • VPC Flow Logs

⚖️ ALB Module

  • Application Load Balancer
  • Health checks
  • S3 access logs
  • Target groups

📈 ASG Module

  • 6 scaling policies
  • Launch templates
  • Warm pools
  • Instance refresh

🗄️ RDS Module

  • MySQL 8.0
  • Multi-AZ support
  • Read replicas
  • Performance Insights

Scaling Policies Implemented

Policy Type Description Trigger
Target Tracking (CPU) Maintains target CPU utilization CPU at 70%
Target Tracking (ALB) Scales based on request count 1000 req/target
Step Scaling (Out) Aggressive scale-out for spikes CPU > 70%/80%
Step Scaling (In) Gradual scale-in when idle CPU < 30%
Scheduled Scaling Time-based capacity changes Business hours
Predictive Scaling ML-based forecasting Traffic patterns

Quick Start

Validate configuration
terraform init && terraform validate
Preview infrastructure (no AWS account needed)
terraform plan -var-file="environments/dev/terraform.tfvars" -var="db_password=demo" -var="use_localstack=true"
Resources created
Plan: 49 to add, 0 to change, 0 to destroy
View on GitHub CI/CD Pipeline