ALB

Definition

An Application Load Balancer (ALB) is a type of load balancer within the Amazon Web Services (AWS) Elastic Load Balancing (ELB) service. It operates at the application layer (Layer 7) of the OSI model, allowing it to route traffic based on advanced application-level information such as HTTP headers, request paths, and more. ALBs are designed to handle complex routing and provide features like host-based and path-based routing, WebSocket support, and integration with AWS services such as AWS WAF for enhanced security.

Secure Settings Example

# AWS CloudFormation template snippet for a secure ALB
Resources:
  MyLoadBalancer:
    Type: "AWS::ElasticLoadBalancingV2::LoadBalancer"
    Properties:
      LoadBalancerAttributes:
        - Key: "idle_timeout.timeout_seconds"
          Value: "60"
        - Key: "routing.http2.enabled"
          Value: "true"
      SecurityGroups:
        - !Ref MySecureSecurityGroup
      Subnets:
        - !Ref PublicSubnet1
        - !Ref PublicSubnet2
      Scheme: "internet-facing"
      IpAddressType: "ipv4"

Insecure Settings Example

# AWS CloudFormation template snippet for an insecure ALB
Resources:
  MyLoadBalancer:
    Type: "AWS::ElasticLoadBalancingV2::LoadBalancer"
    Properties:
      LoadBalancerAttributes:
        - Key: "idle_timeout.timeout_seconds"
          Value: "600"
        - Key: "routing.http2.enabled"
          Value: "false"
      SecurityGroups:
        - !Ref MyOpenSecurityGroup
      Subnets:
        - !Ref PublicSubnet1
        - !Ref PublicSubnet2
      Scheme: "internet-facing"
      IpAddressType: "ipv4"