ListenerProps

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

Bases: aws_cdk.aws_globalaccelerator.ListenerOptions

Construct properties for Listener.

Parameters
  • 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

  • port_ranges (Sequence[PortRange]) – The list of port ranges for the connections from clients to the accelerator.

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

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

Example:

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

# accelerator is of type 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.

Return type

IAccelerator

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

Return type

Optional[ClientAffinity]

listener_name

Name of the listener.

Default
  • logical ID of the resource

Return type

Optional[str]

port_ranges

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

Return type

List[PortRange]

protocol

The protocol for the connections from clients to the accelerator.

Default

ConnectionProtocol.TCP

Return type

Optional[ConnectionProtocol]