Elastic Load Balancing

2020/11/13 - Elastic Load Balancing - 3 updated api methods

Changes  Adds dualstack support for Network Load Balancers (TCP/TLS only), an attribute for WAF fail open for Application Load Balancers, and an attribute for connection draining for Network Load Balancers.

CreateLoadBalancer (updated) Link ¶
Changes (request, response)
Request
{'SubnetMappings': {'IPv6Address': 'string'}}
Response
{'LoadBalancers': {'AvailabilityZones': {'LoadBalancerAddresses': {'IPv6Address': 'string'}}}}

Creates an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.

For more information, see the following:

This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple load balancers with the same settings, each call succeeds.

See also: AWS API Documentation

Request Syntax

client.create_load_balancer(
    Name='string',
    Subnets=[
        'string',
    ],
    SubnetMappings=[
        {
            'SubnetId': 'string',
            'AllocationId': 'string',
            'PrivateIPv4Address': 'string',
            'IPv6Address': 'string'
        },
    ],
    SecurityGroups=[
        'string',
    ],
    Scheme='internet-facing'|'internal',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    Type='application'|'network'|'gateway',
    IpAddressType='ipv4'|'dualstack',
    CustomerOwnedIpv4Pool='string'
)
type Name

string

param Name

[REQUIRED]

The name of the load balancer.

This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, must not begin or end with a hyphen, and must not begin with "internal-".

type Subnets

list

param Subnets

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones.

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones.

  • (string) --

type SubnetMappings

list

param SubnetMappings

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.

[Gateway Load Balancers] You can specify subnets from one or more Availability Zones. You cannot specify Elastic IP addresses for your subnets.

  • (dict) --

    Information about a subnet mapping.

    • SubnetId (string) --

      The ID of the subnet.

    • AllocationId (string) --

      [Network Load Balancers] The allocation ID of the Elastic IP address for an internet-facing load balancer.

    • PrivateIPv4Address (string) --

      [Network Load Balancers] The private IPv4 address for an internal load balancer.

    • IPv6Address (string) --

      [Network Load Balancers] The IPv6 address.

type SecurityGroups

list

param SecurityGroups

[Application Load Balancers] The IDs of the security groups for the load balancer.

  • (string) --

type Scheme

string

param Scheme

The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the internet.

The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to the VPC for the load balancer.

The default is an Internet-facing load balancer.

You cannot specify a scheme for a Gateway Load Balancer.

type Tags

list

param Tags

The tags to assign to the load balancer.

  • (dict) --

    Information about a tag.

    • Key (string) -- [REQUIRED]

      The key of the tag.

    • Value (string) --

      The value of the tag.

type Type

string

param Type

The type of load balancer. The default is application .

type IpAddressType

string

param IpAddressType

The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses). Internal load balancers must use ipv4 .

type CustomerOwnedIpv4Pool

string

param CustomerOwnedIpv4Pool

[Application Load Balancers on Outposts] The ID of the customer-owned address pool (CoIP pool).

rtype

dict

returns

Response Syntax

{
    'LoadBalancers': [
        {
            'LoadBalancerArn': 'string',
            'DNSName': 'string',
            'CanonicalHostedZoneId': 'string',
            'CreatedTime': datetime(2015, 1, 1),
            'LoadBalancerName': 'string',
            'Scheme': 'internet-facing'|'internal',
            'VpcId': 'string',
            'State': {
                'Code': 'active'|'provisioning'|'active_impaired'|'failed',
                'Reason': 'string'
            },
            'Type': 'application'|'network'|'gateway',
            'AvailabilityZones': [
                {
                    'ZoneName': 'string',
                    'SubnetId': 'string',
                    'OutpostId': 'string',
                    'LoadBalancerAddresses': [
                        {
                            'IpAddress': 'string',
                            'AllocationId': 'string',
                            'PrivateIPv4Address': 'string',
                            'IPv6Address': 'string'
                        },
                    ]
                },
            ],
            'SecurityGroups': [
                'string',
            ],
            'IpAddressType': 'ipv4'|'dualstack',
            'CustomerOwnedIpv4Pool': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • LoadBalancers (list) --

      Information about the load balancer.

      • (dict) --

        Information about a load balancer.

        • LoadBalancerArn (string) --

          The Amazon Resource Name (ARN) of the load balancer.

        • DNSName (string) --

          The public DNS name of the load balancer.

        • CanonicalHostedZoneId (string) --

          The ID of the Amazon Route 53 hosted zone associated with the load balancer.

        • CreatedTime (datetime) --

          The date and time the load balancer was created.

        • LoadBalancerName (string) --

          The name of the load balancer.

        • Scheme (string) --

          The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the internet.

          The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to the VPC for the load balancer.

        • VpcId (string) --

          The ID of the VPC for the load balancer.

        • State (dict) --

          The state of the load balancer.

          • Code (string) --

            The state code. The initial state of the load balancer is provisioning . After the load balancer is fully set up and ready to route traffic, its state is active . If the load balancer could not be set up, its state is failed .

          • Reason (string) --

            A description of the state.

        • Type (string) --

          The type of load balancer.

        • AvailabilityZones (list) --

          The subnets for the load balancer.

          • (dict) --

            Information about an Availability Zone.

            • ZoneName (string) --

              The name of the Availability Zone.

            • SubnetId (string) --

              The ID of the subnet. You can specify one subnet per Availability Zone.

            • OutpostId (string) --

              [Application Load Balancers on Outposts] The ID of the Outpost.

            • LoadBalancerAddresses (list) --

              [Network Load Balancers] If you need static IP addresses for your load balancer, you can specify one Elastic IP address per Availability Zone when you create an internal-facing load balancer. For internal load balancers, you can specify a private IP address from the IPv4 range of the subnet.

              • (dict) --

                Information about a static IP address for a load balancer.

                • IpAddress (string) --

                  The static IP address.

                • AllocationId (string) --

                  [Network Load Balancers] The allocation ID of the Elastic IP address for an internal-facing load balancer.

                • PrivateIPv4Address (string) --

                  [Network Load Balancers] The private IPv4 address for an internal load balancer.

                • IPv6Address (string) --

                  [Network Load Balancers] The IPv6 address.

        • SecurityGroups (list) --

          The IDs of the security groups for the load balancer.

          • (string) --

        • IpAddressType (string) --

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

        • CustomerOwnedIpv4Pool (string) --

          [Application Load Balancers on Outposts] The ID of the customer-owned address pool.

DescribeLoadBalancers (updated) Link ¶
Changes (response)
{'LoadBalancers': {'AvailabilityZones': {'LoadBalancerAddresses': {'IPv6Address': 'string'}}}}

Describes the specified load balancers or all of your load balancers.

See also: AWS API Documentation

Request Syntax

client.describe_load_balancers(
    LoadBalancerArns=[
        'string',
    ],
    Names=[
        'string',
    ],
    Marker='string',
    PageSize=123
)
type LoadBalancerArns

list

param LoadBalancerArns

The Amazon Resource Names (ARN) of the load balancers. You can specify up to 20 load balancers in a single call.

  • (string) --

type Names

list

param Names

The names of the load balancers.

  • (string) --

type Marker

string

param Marker

The marker for the next set of results. (You received this marker from a previous call.)

type PageSize

integer

param PageSize

The maximum number of results to return with this call.

rtype

dict

returns

Response Syntax

{
    'LoadBalancers': [
        {
            'LoadBalancerArn': 'string',
            'DNSName': 'string',
            'CanonicalHostedZoneId': 'string',
            'CreatedTime': datetime(2015, 1, 1),
            'LoadBalancerName': 'string',
            'Scheme': 'internet-facing'|'internal',
            'VpcId': 'string',
            'State': {
                'Code': 'active'|'provisioning'|'active_impaired'|'failed',
                'Reason': 'string'
            },
            'Type': 'application'|'network'|'gateway',
            'AvailabilityZones': [
                {
                    'ZoneName': 'string',
                    'SubnetId': 'string',
                    'OutpostId': 'string',
                    'LoadBalancerAddresses': [
                        {
                            'IpAddress': 'string',
                            'AllocationId': 'string',
                            'PrivateIPv4Address': 'string',
                            'IPv6Address': 'string'
                        },
                    ]
                },
            ],
            'SecurityGroups': [
                'string',
            ],
            'IpAddressType': 'ipv4'|'dualstack',
            'CustomerOwnedIpv4Pool': 'string'
        },
    ],
    'NextMarker': 'string'
}

Response Structure

  • (dict) --

    • LoadBalancers (list) --

      Information about the load balancers.

      • (dict) --

        Information about a load balancer.

        • LoadBalancerArn (string) --

          The Amazon Resource Name (ARN) of the load balancer.

        • DNSName (string) --

          The public DNS name of the load balancer.

        • CanonicalHostedZoneId (string) --

          The ID of the Amazon Route 53 hosted zone associated with the load balancer.

        • CreatedTime (datetime) --

          The date and time the load balancer was created.

        • LoadBalancerName (string) --

          The name of the load balancer.

        • Scheme (string) --

          The nodes of an Internet-facing load balancer have public IP addresses. The DNS name of an Internet-facing load balancer is publicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the internet.

          The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can route requests only from clients with access to the VPC for the load balancer.

        • VpcId (string) --

          The ID of the VPC for the load balancer.

        • State (dict) --

          The state of the load balancer.

          • Code (string) --

            The state code. The initial state of the load balancer is provisioning . After the load balancer is fully set up and ready to route traffic, its state is active . If the load balancer could not be set up, its state is failed .

          • Reason (string) --

            A description of the state.

        • Type (string) --

          The type of load balancer.

        • AvailabilityZones (list) --

          The subnets for the load balancer.

          • (dict) --

            Information about an Availability Zone.

            • ZoneName (string) --

              The name of the Availability Zone.

            • SubnetId (string) --

              The ID of the subnet. You can specify one subnet per Availability Zone.

            • OutpostId (string) --

              [Application Load Balancers on Outposts] The ID of the Outpost.

            • LoadBalancerAddresses (list) --

              [Network Load Balancers] If you need static IP addresses for your load balancer, you can specify one Elastic IP address per Availability Zone when you create an internal-facing load balancer. For internal load balancers, you can specify a private IP address from the IPv4 range of the subnet.

              • (dict) --

                Information about a static IP address for a load balancer.

                • IpAddress (string) --

                  The static IP address.

                • AllocationId (string) --

                  [Network Load Balancers] The allocation ID of the Elastic IP address for an internal-facing load balancer.

                • PrivateIPv4Address (string) --

                  [Network Load Balancers] The private IPv4 address for an internal load balancer.

                • IPv6Address (string) --

                  [Network Load Balancers] The IPv6 address.

        • SecurityGroups (list) --

          The IDs of the security groups for the load balancer.

          • (string) --

        • IpAddressType (string) --

          The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses).

        • CustomerOwnedIpv4Pool (string) --

          [Application Load Balancers on Outposts] The ID of the customer-owned address pool.

    • NextMarker (string) --

      If there are additional results, this is the marker for the next set of results. Otherwise, this is null.

SetSubnets (updated) Link ¶
Changes (request, response)
Request
{'IpAddressType': 'ipv4 | dualstack',
 'SubnetMappings': {'IPv6Address': 'string'}}
Response
{'AvailabilityZones': {'LoadBalancerAddresses': {'IPv6Address': 'string'}},
 'IpAddressType': 'ipv4 | dualstack'}

Enables the Availability Zones for the specified public subnets for the specified Application Load Balancer or Network Load Balancer. The specified subnets replace the previously enabled subnets.

When you specify subnets for a Network Load Balancer, you must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.

See also: AWS API Documentation

Request Syntax

client.set_subnets(
    LoadBalancerArn='string',
    Subnets=[
        'string',
    ],
    SubnetMappings=[
        {
            'SubnetId': 'string',
            'AllocationId': 'string',
            'PrivateIPv4Address': 'string',
            'IPv6Address': 'string'
        },
    ],
    IpAddressType='ipv4'|'dualstack'
)
type LoadBalancerArn

string

param LoadBalancerArn

[REQUIRED]

The Amazon Resource Name (ARN) of the load balancer.

type Subnets

list

param Subnets

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.

[Application Load Balancers] You must specify subnets from at least two Availability Zones.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones.

  • (string) --

type SubnetMappings

list

param SubnetMappings

The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.

[Application Load Balancers] You must specify subnets from at least two Availability Zones. You cannot specify Elastic IP addresses for your subnets.

[Application Load Balancers on Outposts] You must specify one Outpost subnet.

[Application Load Balancers on Local Zones] You can specify subnets from one or more Local Zones.

[Network Load Balancers] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.

  • (dict) --

    Information about a subnet mapping.

    • SubnetId (string) --

      The ID of the subnet.

    • AllocationId (string) --

      [Network Load Balancers] The allocation ID of the Elastic IP address for an internet-facing load balancer.

    • PrivateIPv4Address (string) --

      [Network Load Balancers] The private IPv4 address for an internal load balancer.

    • IPv6Address (string) --

      [Network Load Balancers] The IPv6 address.

type IpAddressType

string

param IpAddressType

[Network Load Balancers] The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 (for IPv4 addresses) and dualstack (for IPv4 and IPv6 addresses). You can’t specify dualstack for a load balancer with a UDP or TCP_UDP listener. Internal load balancers must use ipv4 .

rtype

dict

returns

Response Syntax

{
    'AvailabilityZones': [
        {
            'ZoneName': 'string',
            'SubnetId': 'string',
            'OutpostId': 'string',
            'LoadBalancerAddresses': [
                {
                    'IpAddress': 'string',
                    'AllocationId': 'string',
                    'PrivateIPv4Address': 'string',
                    'IPv6Address': 'string'
                },
            ]
        },
    ],
    'IpAddressType': 'ipv4'|'dualstack'
}

Response Structure

  • (dict) --

    • AvailabilityZones (list) --

      Information about the subnets.

      • (dict) --

        Information about an Availability Zone.

        • ZoneName (string) --

          The name of the Availability Zone.

        • SubnetId (string) --

          The ID of the subnet. You can specify one subnet per Availability Zone.

        • OutpostId (string) --

          [Application Load Balancers on Outposts] The ID of the Outpost.

        • LoadBalancerAddresses (list) --

          [Network Load Balancers] If you need static IP addresses for your load balancer, you can specify one Elastic IP address per Availability Zone when you create an internal-facing load balancer. For internal load balancers, you can specify a private IP address from the IPv4 range of the subnet.

          • (dict) --

            Information about a static IP address for a load balancer.

            • IpAddress (string) --

              The static IP address.

            • AllocationId (string) --

              [Network Load Balancers] The allocation ID of the Elastic IP address for an internal-facing load balancer.

            • PrivateIPv4Address (string) --

              [Network Load Balancers] The private IPv4 address for an internal load balancer.

            • IPv6Address (string) --

              [Network Load Balancers] The IPv6 address.

    • IpAddressType (string) --

      [Network Load Balancers] The IP address type.