🌉
Internet Gateway (IGW)
public route 0.0.0.0/0 → IGW · Attached to VPC 10.1.0.0/16
🟢 Public Subnets — 1a 10.1.1.0/24 · 1b 10.1.2.0/24 · 1c 10.1.3.0/24
⚖️
App Load Balancer
Internet-facing · multi-AZ
:80 → 301 redirect HTTPS
:443 → TG :8080 · TLS1.3
Logs
→ S3 alb-logs
ALB-SG
🎯
Target Group
Port 8080 · HTTP
Health /health · 3×30s
Deregister delay 30s
Stickiness off
🔀
NAT GW — 1a
Elastic IP
10.1.1.0/24
Egress EC2-1a
🔀
NAT GW — 1b
Elastic IP
10.1.2.0/24
Egress EC2-1b
🔀
NAT GW — 1c
Elastic IP
10.1.3.0/24
Egress EC2-1c
🏰
Bastion Host
t3.nano · AL2023
Elastic IP · gp3 8GB enc
IMDSv2 · SSH key auth
Auto-stop 00:00
UTC
Bastion-SG
Public Route Table
0.0.0.0/0 → IGW
ALB-SG: :80/:443 ← 0.0.0.0/0
Bastion-SG: :22 ← CIDRs
🔵 Private Subnets (App Tier) — 1a 10.1.10.0/24 · 1b 10.1.11.0/24 · 1c 10.1.12.0/24
📈
Auto Scaling Group
min 2 · max 8 · desired 3
CPU target 60%
Rolling refresh 50%
Scale ↓20:00 ↑07:00
UTC
3-AZ distribution
🖥️
EC2 — 1a
t3.small · AL2023
App :8080 · gp3 enc
IMDSv2 required
IAM profile attached
ap-south-1a
🖥️
EC2 — 1b
t3.small · AL2023
App :8080 · gp3 enc
IMDSv2 required
IAM profile attached
ap-south-1b
🖥️
EC2 — 1c
t3.small · AL2023
App :8080 · gp3 enc
IMDSv2 required
IAM profile attached
ap-south-1c
📋
Launch Template
AL2023 AMI (HVM)
IAM Instance Profile
Key pair ecia-prod-key
user-data bootstrap
Private Route Tables (×3)
0.0.0.0/0 → NAT GW (per-AZ)
App-SG: :8080 ← ALB-SG
App-SG: :22 ← allowed CIDRs
No
direct internet to EC2
🔴 DB Subnets — 1a 10.1.20.0/24 · 1b 10.1.21.0/24 · 1c 10.1.22.0/24
🗄️
RDS — Primary
MySQL 8.0.39 · db.t3.small
gp3 20GB (max 100GB)
KMS encrypted · Multi-AZ:
true
IAM DB auth · port 3306
DB-SG · :3306 ← App-SG
🗄️
RDS — Standby
Multi-AZ sync replica
Auto-failover < 2 min
No app config change
Different AZ
from primary
Auto-failover
DB Subnet Group
ecia-prod-db-subnet-grp
Spans 1a + 1b + 1c
DB-SG: :3306/:5432
Inbound ← App-SG
only
DB Parameter Group
mysql8.0 family
slow_query_log = 1
long_query_time = 2s
Logs → CloudWatch
RDS Monitoring
Enhanced Mon 60s
Backup retain 1d · 02:00–03:00
Maint: sun 04:00
final_snapshot
on delete