Archive · AWS

Serving Traffic: ALB and Route 53

Put an Application Load Balancer in front of two instances and point a domain at it.

1 min read

  • Application Load Balancer
  • Amazon Route 53
  • AWS Certificate Manager
flowchart LR
  U[Users] --> R[Route 53 alias record]
  R --> L[Application Load Balancer<br/>HTTPS 443]
  L --> A[EC2 in AZ a]
  L --> B[EC2 in AZ b]
  1. Launch two instances in different Availability Zones.
  2. Create a target group with a health check path such as /health, and register both instances.
  3. Create an Application Load Balancer across at least two public subnets, with an HTTPS listener using a free certificate from AWS Certificate Manager.
  4. Redirect HTTP (80) to HTTPS in the listener rules.
  5. In Route 53 create an A (alias) record that points to the load balancer. Alias records work at the zone apex and cost nothing for queries to AWS resources.

Tighten security groups: the instances should accept traffic only from the load balancer’s security group, not from the internet.

Watch HTTPCode_Target_5XX_Count and UnHealthyHostCount in CloudWatch. A failing health check removes an instance from rotation, which is why the check path must reflect real readiness.