aws-cdk-lib.aws_globalaccelerator.ListenerProps

interface ListenerProps

LanguageType name
.NETAmazon.CDK.AWS.GlobalAccelerator.ListenerProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsglobalaccelerator#ListenerProps
Javasoftware.amazon.awscdk.services.globalaccelerator.ListenerProps
Pythonaws_cdk.aws_globalaccelerator.ListenerProps
TypeScript (source)aws-cdk-lib » aws_globalaccelerator » ListenerProps

Construct properties for Listener.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_globalaccelerator as globalaccelerator } from 'aws-cdk-lib';

declare const accelerator: globalaccelerator.Accelerator;
const listenerProps: globalaccelerator.ListenerProps = {
  accelerator: accelerator,
  portRanges: [{
    fromPort: 123,

    // the properties below are optional
    toPort: 123,
  }],

  // the properties below are optional
  clientAffinity: globalaccelerator.ClientAffinity.NONE,
  listenerName: 'listenerName',
  protocol: globalaccelerator.ConnectionProtocol.TCP,
};

Properties

NameTypeDescription
acceleratorIAcceleratorThe accelerator for this listener.
portRangesPortRange[]The list of port ranges for the connections from clients to the accelerator.
clientAffinity?ClientAffinityClient affinity to direct all requests from a user to the same endpoint.
listenerName?stringName of the listener.
protocol?ConnectionProtocolThe protocol for the connections from clients to the accelerator.

accelerator

Type: IAccelerator

The accelerator for this listener.


portRanges

Type: PortRange[]

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


clientAffinity?

Type: ClientAffinity (optional, default: ClientAffinity.NONE)

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.


listenerName?

Type: string (optional, default: logical ID of the resource)

Name of the listener.


protocol?

Type: ConnectionProtocol (optional, default: ConnectionProtocol.TCP)

The protocol for the connections from clients to the accelerator.