🟢

Application Load Balancer (ALB)

  • Operates at Layer 7 (HTTP/HTTPS)
  • Can distribute traffic to:
    • Multiple HTTP applications across instances (target groups)
    • Multiple applications on the same instance (e.g., containers)
  • Supports HTTP/2 and WebSocket protocols
  • Can perform redirects (e.g., HTTP → HTTPS)
  • Ideal for microservices and containerized applications (e.g., Docker, Amazon ECS)
  • Supports dynamic port mapping in ECS, allowing tasks to register with any available port

Advanced Routing Features

  • Can route requests to different target groups based on:
    • Path-based routing: /users → Users TG, /search → Search TG
    • Host-based routing: app.example.com vs api.example.com
    • Query string or header values: ?platform=mobile → TG1, ?platform=desktop → TG2
  • Target groups can contain:
    • EC2 instances (standalone or in an Auto Scaling Group)
    • ECS tasks
    • Lambda functions (HTTP request → JSON event)
    • Private IP addresses (for hybrid on-prem routing)
  • Health checks are configured at the target group level
  • Supports routing across AWS and on-prem environments

Networking & Hostname

  • ALB has a fixed DNS name: xxx.region.elb.amazonaws.com
  • The original client IP is not directly visible to the target; instead:
    • X-Forwarded-For → client IP
    • X-Forwarded-Port → original client port
    • X-Forwarded-Proto → original protocol (HTTP/HTTPS)