Company: Lyft | Difficulty: Hard
You need to deploy a web application accessible only within a VPC. EC2 instances run in private subnets behind an Application Load Balancer in public subnets. A startup script at /tmp/userdata.sh runs a simple HTTP server with a /health endpoint on port 80.
- Create a VPC named
app-vpcusing CIDR10.0.0.0/16with public and private subnets across two availability zones - Establish two security groups:
alb-sgallowing HTTP from internal networks, andec2-sgallowing HTTP only from the load balancer - Launch two EC2 instances in private subnets using Amazon Linux 2 AMI with the provided startup script
- Configure an ALB named
app-albwith target groupapp-tg, health checks at/health, and HTTP listener on port 80 - Create a private Route 53 hosted zone for
internal.example.comand add a CNAME recordapp.internal.example.compointing to the ALB