Interview Prep/AWS/EC2, Auto Scaling and Load Balancing

An ALB must route `/api` to one service and `/` to another, and also redirect HTTP to HTTPS. How?

IntermediateScenarioEC2, Auto Scaling and Load Balancing
Answer

Situation read → Listener rules handle path routing and redirects natively.

What I'd do →

  1. Listener 80: default action redirect to HTTPS 443 with status 301
  2. Listener 443 with ACM certificate and a rule path-pattern /api/* forwarding to the api target group
  3. Default action forward to the web target group
  4. Check rule priority order
  5. aws elbv2 describe-rules --listener-arn ...

Why → Rules evaluate in priority order, so specific paths must come before the catch-all.

Interview tip → Mention host-header rules for multi-tenant routing.

aws All AWS questions Roadmap: AWS core services

More on EC2, Auto Scaling and Load Balancing