GlobalAccelerator / Client / add_endpoints

add_endpoints#

GlobalAccelerator.Client.add_endpoints(**kwargs)#

Add endpoints to an endpoint group. The AddEndpoints API operation is the recommended option for adding endpoints. The alternative options are to add endpoints when you create an endpoint group (with the CreateEndpointGroup API) or when you update an endpoint group (with the UpdateEndpointGroup API).

There are two advantages to using AddEndpoints to add endpoints in Global Accelerator:

  • It’s faster, because Global Accelerator only has to resolve the new endpoints that you’re adding, rather than resolving new and existing endpoints.

  • It’s more convenient, because you don’t need to specify the current endpoints that are already in the endpoint group, in addition to the new endpoints that you want to add.

For information about endpoint types and requirements for endpoints that you can add to Global Accelerator, see Endpoints for standard accelerators in the Global Accelerator Developer Guide.

See also: AWS API Documentation

Request Syntax

response = client.add_endpoints(
    EndpointConfigurations=[
        {
            'EndpointId': 'string',
            'Weight': 123,
            'ClientIPPreservationEnabled': True|False
        },
    ],
    EndpointGroupArn='string'
)
Parameters:
  • EndpointConfigurations (list) –

    [REQUIRED]

    The list of endpoint objects.

    • (dict) –

      A complex type for endpoints. A resource must be valid and active when you add it as an endpoint.

      • EndpointId (string) –

        An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID. A resource must be valid and active when you add it as an endpoint.

        An Application Load Balancer can be either internal or internet-facing.

      • Weight (integer) –

        The weight associated with the endpoint. When you add weights to endpoints, you configure Global Accelerator to route traffic based on proportions that you specify. For example, you might specify endpoint weights of 4, 5, 5, and 6 (sum=20). The result is that 4/20 of your traffic, on average, is routed to the first endpoint, 5/20 is routed both to the second and third endpoints, and 6/20 is routed to the last endpoint. For more information, see Endpoint weights in the Global Accelerator Developer Guide.

      • ClientIPPreservationEnabled (boolean) –

        Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false. The default value is true for new accelerators.

        If the value is set to true, the client’s IP address is preserved in the X-Forwarded-For request header as traffic travels to applications on the endpoint fronted by the accelerator.

        Client IP address preservation is supported, in specific Amazon Web Services Regions, for endpoints that are Application Load Balancers, Amazon EC2 instances, and Network Load Balancers with Security Groups. IMPORTANT: You cannot use client IP address preservation with Network Load Balancers with TLS listeners.

        For more information, see Preserve client IP addresses in Global Accelerator in the Global Accelerator Developer Guide.

  • EndpointGroupArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the endpoint group.

Return type:

dict

Returns:

Response Syntax

{
    'EndpointDescriptions': [
        {
            'EndpointId': 'string',
            'Weight': 123,
            'HealthState': 'INITIAL'|'HEALTHY'|'UNHEALTHY',
            'HealthReason': 'string',
            'ClientIPPreservationEnabled': True|False
        },
    ],
    'EndpointGroupArn': 'string'
}

Response Structure

  • (dict) –

    • EndpointDescriptions (list) –

      The list of endpoint objects.

      • (dict) –

        A complex type for an endpoint. Each endpoint group can include one or more endpoints, such as load balancers.

        • EndpointId (string) –

          An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID.

          An Application Load Balancer can be either internal or internet-facing.

        • Weight (integer) –

          The weight associated with the endpoint. When you add weights to endpoints, you configure Global Accelerator to route traffic based on proportions that you specify. For example, you might specify endpoint weights of 4, 5, 5, and 6 (sum=20). The result is that 4/20 of your traffic, on average, is routed to the first endpoint, 5/20 is routed both to the second and third endpoints, and 6/20 is routed to the last endpoint. For more information, see Endpoint weights in the Global Accelerator Developer Guide.

        • HealthState (string) –

          The health status of the endpoint.

        • HealthReason (string) –

          Returns a null result.

        • ClientIPPreservationEnabled (boolean) –

          Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false. The default value is true for new accelerators.

          If the value is set to true, the client’s IP address is preserved in the X-Forwarded-For request header as traffic travels to applications on the endpoint fronted by the accelerator.

          Client IP address preservation is supported, in specific Amazon Web Services Regions, for endpoints that are Application Load Balancers, Amazon EC2 instances, and Network Load Balancers with Security Groups. IMPORTANT: You cannot use client IP address preservation with Network Load Balancers with TLS listeners.

          For more information, see Preserve client IP addresses in Global Accelerator in the Global Accelerator Developer Guide.

    • EndpointGroupArn (string) –

      The Amazon Resource Name (ARN) of the endpoint group.

Exceptions

  • GlobalAccelerator.Client.exceptions.TransactionInProgressException

  • GlobalAccelerator.Client.exceptions.EndpointGroupNotFoundException

  • GlobalAccelerator.Client.exceptions.InternalServiceErrorException

  • GlobalAccelerator.Client.exceptions.InvalidArgumentException

  • GlobalAccelerator.Client.exceptions.LimitExceededException

  • GlobalAccelerator.Client.exceptions.AccessDeniedException