Skip to content

kazmithub/Terraform-2Tier-RDS

Repository files navigation

Terraform 2-Tier Architecture with RDS

Production-grade 2-tier web application infrastructure on AWS with VPC, ALB, Auto Scaling, and RDS Multi-AZ.

Architecture

Internet --> ALB
              |
              v
         Public Subnets (2 AZs)
         [EC2 Auto Scaling Group]
              |
              v
         Private Subnets (2 AZs)
         [RDS MySQL Multi-AZ]
              |
         Secrets Manager
         (DB Credentials)

Key Features

  • VPC - 4 subnets across 2 AZs (2 public, 2 private)
  • RDS Multi-AZ - MySQL with automatic failover and Performance Insights
  • Auto Scaling - EC2 instances scale based on demand
  • ALB - Application Load Balancer with health checks
  • Secrets Manager - Secure, rotatable database credentials
  • CloudWatch - Alarms for CPU, connections, and storage
  • NAT Gateway - Secure outbound access from private subnets

Modules

Module Purpose
vpc VPC, subnets, NAT Gateway, route tables
database RDS MySQL Multi-AZ, parameter groups
ec2 Launch template, ASG, ALB, target groups

Prerequisites

  • AWS CLI v2
  • Terraform >= 1.5.0

Deployment

terraform init
terraform plan
terraform apply

Cleanup

terraform destroy

License

MIT

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors