
3-Tier Lab (Web + App + DB)
Target Architecture ALB (public) → routes HTTP to Web tier (Nginx) Web tier (EC2 ASG) → reverse proxies to App tier App tier (EC2 ASG) → runs a simple Node.js API (or Python Flask) DB tier (RDS MySQL/Postgres) → app connects privately Ansible configures EC2 instances (web/app) Terraform provisions AWS resources GitLab CI runs Terraform + Ansible automatically on push Launch 3 EC2 (or 2 EC2 + RDS): web-1 (public subnet, port 80 open from ALB only) app-1 (private subnet, port 3000 from web SG only) db (RDS in private subnet, port 3306/5432 from app SG only) Validate connectivity: web → app works (curl app private IP) app → db works (connect using client) Minimal app idea A tiny API endpoint: GET /health returns OK GET / returns “Hello from app” B) Add Load Balancer + Auto Deploy App 1) ALB in front of Web Create ALB (public subnets) Target group → web ASG (port 80) 2) Web reverse proxies to App Nginx config (Ansible-managed) proxies /api to app target group. Example Nginx snippet (concep
Continue reading on Dev.to DevOps
Opens in a new tab

![[MM’s] Boot Notes — The Day Zero Blueprint — Test Smarter on Day One](/_next/image?url=https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1368%2F1*AvVpFzkFJBm-xns4niPLAA.png&w=1200&q=75)

