GlobalAccelerator / Client / list_custom_routing_port_mappings

list_custom_routing_port_mappings#

GlobalAccelerator.Client.list_custom_routing_port_mappings(**kwargs)#

Provides a complete mapping from the public accelerator IP address and port to destination EC2 instance IP addresses and ports in the virtual public cloud (VPC) subnet endpoint for a custom routing accelerator. For each subnet endpoint that you add, Global Accelerator creates a new static port mapping for the accelerator. The port mappings don’t change after Global Accelerator generates them, so you can retrieve and cache the full mapping on your servers.

If you remove a subnet from your accelerator, Global Accelerator removes (reclaims) the port mappings. If you add a subnet to your accelerator, Global Accelerator creates new port mappings (the existing ones don’t change). If you add or remove EC2 instances in your subnet, the port mappings don’t change, because the mappings are created when you add the subnet to Global Accelerator.

The mappings also include a flag for each destination denoting which destination IP addresses and ports are allowed or denied traffic.

See also: AWS API Documentation

Request Syntax

response = client.list_custom_routing_port_mappings(
    AcceleratorArn='string',
    EndpointGroupArn='string',
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • AcceleratorArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the accelerator to list the custom routing port mappings for.

  • EndpointGroupArn (string) – The Amazon Resource Name (ARN) of the endpoint group to list the custom routing port mappings for.

  • MaxResults (integer) – The number of destination port mappings that you want to return with this call. The default value is 10.

  • NextToken (string) – The token for the next set of results. You receive this token from a previous call.

Return type:

dict

Returns:

Response Syntax

{
    'PortMappings': [
        {
            'AcceleratorPort': 123,
            'EndpointGroupArn': 'string',
            'EndpointId': 'string',
            'DestinationSocketAddress': {
                'IpAddress': 'string',
                'Port': 123
            },
            'Protocols': [
                'TCP'|'UDP',
            ],
            'DestinationTrafficState': 'ALLOW'|'DENY'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • PortMappings (list) –

      The port mappings for a custom routing accelerator.

      • (dict) –

        Returns the ports and associated IP addresses and ports of Amazon EC2 instances in your virtual private cloud (VPC) subnets. Custom routing is a port mapping protocol in Global Accelerator that statically associates port ranges with VPC subnets, which allows Global Accelerator to route to specific instances and ports within one or more subnets.

        • AcceleratorPort (integer) –

          The accelerator port.

        • EndpointGroupArn (string) –

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

        • EndpointId (string) –

          The IP address of the VPC subnet (the subnet ID).

        • DestinationSocketAddress (dict) –

          The EC2 instance IP address and port number in the virtual private cloud (VPC) subnet.

          • IpAddress (string) –

            The IP address for the socket address.

          • Port (integer) –

            The port for the socket address.

        • Protocols (list) –

          The protocols supported by the endpoint group.

          • (string) –

        • DestinationTrafficState (string) –

          Indicates whether or not a port mapping destination can receive traffic. The value is either ALLOW, if traffic is allowed to the destination, or DENY, if traffic is not allowed to the destination.

    • NextToken (string) –

      The token for the next set of results. You receive this token from a previous call.

Exceptions

  • GlobalAccelerator.Client.exceptions.InvalidArgumentException

  • GlobalAccelerator.Client.exceptions.InvalidNextTokenException

  • GlobalAccelerator.Client.exceptions.EndpointGroupNotFoundException

  • GlobalAccelerator.Client.exceptions.AcceleratorNotFoundException

  • GlobalAccelerator.Client.exceptions.InternalServiceErrorException