This project deploys a 3-tier web application architecture on AWS using Terraform with a focus on high availability (HA), security, and modular design. It includes a VPC, Application Load Balancer (ALB), EC2 Auto Scaling Group, and RDS database.
The system is composed of:
- VPC & Subnets
- Security Groups
- Application Load Balancer (ALB)
- EC2 Auto Scaling Group
- RDS Database
aws-multi-tier-webapp-terraform/ ├── modules/ │ ├── vpc/ │ ├── security-groups/ │ ├── alb/ │ ├── ec2-asg/ │ └── rds/ └── environments/ └── dev/ ├── main.tf ├── variables.tf ├── terraform.tfvars └── backend.tf
These images demonstrate that the infrastructure is deployed correctly:
Shows public, private, and DB subnets.
Inbound/outbound rules for ALB, App, and DB tiers.
Inbound/outbound rules for App tier.
Inbound/outbound rules for ALB tier.
Inbound/outbound rules for DB tier.
Public ALB with listeners and target group.
All EC2 instances registered and healthy.
Shows running instances across multiple AZs.
Multi-AZ private database with endpoint.
Connection to EC2 without SSH.
- Initialize Terraform:
cd aws-multi-tier-webapp-terraform/environments/dev
terraform init - Validate configuration:
terraform validate - Preview plan:
terraform plan - Apply changes:
terraform apply
-
Check Terraform outputs
-
Open ALB DNS in browser
-
Verify Target Group health
-
Connect to EC2 via SSM
-
Test Auto Scaling by terminating instance
-
Connect from EC2 to RDS
-
Verify security rules (DB private, SG restrictions)
