ListenerProps

class aws_cdk.aws_globalaccelerator.ListenerProps(*, port_ranges, client_affinity=None, listener_name=None, protocol=None, accelerator)

Bases: ListenerOptions

Construct properties for Listener.

Parameters:
  • port_ranges (Sequence[Union[PortRange, Dict[str, Any]]]) – The list of port ranges for the connections from clients to the accelerator.

  • client_affinity (Optional[ClientAffinity]) – Client affinity to direct all requests from a user to the same endpoint. If you have stateful applications, client affinity lets you direct all requests from a user to the same endpoint. By default, each connection from each client is routed to seperate endpoints. Set client affinity to SOURCE_IP to route all connections from a single client to the same endpoint. Default: ClientAffinity.NONE

  • listener_name (Optional[str]) – Name of the listener. Default: - logical ID of the resource

  • protocol (Optional[ConnectionProtocol]) – The protocol for the connections from clients to the accelerator. Default: ConnectionProtocol.TCP

  • accelerator (IAccelerator) – The accelerator for this listener.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_globalaccelerator as globalaccelerator

# accelerator: globalaccelerator.Accelerator

listener_props = globalaccelerator.ListenerProps(
    accelerator=accelerator,
    port_ranges=[globalaccelerator.PortRange(
        from_port=123,

        # the properties below are optional
        to_port=123
    )],

    # the properties below are optional
    client_affinity=globalaccelerator.ClientAffinity.NONE,
    listener_name="listenerName",
    protocol=globalaccelerator.ConnectionProtocol.TCP
)

Attributes

accelerator

The accelerator for this listener.

client_affinity

Client affinity to direct all requests from a user to the same endpoint.

If you have stateful applications, client affinity lets you direct all requests from a user to the same endpoint.

By default, each connection from each client is routed to seperate endpoints. Set client affinity to SOURCE_IP to route all connections from a single client to the same endpoint.

Default:

ClientAffinity.NONE

listener_name

Name of the listener.

Default:
  • logical ID of the resource

port_ranges

The list of port ranges for the connections from clients to the accelerator.

protocol

The protocol for the connections from clients to the accelerator.

Default:

ConnectionProtocol.TCP