AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

Listener

The construct for the Listener.

Import

import { Listener } from 'aws-cdk-lib/aws-globalaccelerator';

Or use the module namespace:

import * as globalaccelerator from 'aws-cdk-lib/aws-globalaccelerator';
// globalaccelerator.Listener

Properties

Configuration passed to the constructor as ListenerProps.

acceleratorRequired
IAcceleratorRef

The accelerator for this listener.

4 properties inherited from ListenerOptions
portRangesRequiredinherited from ListenerOptions
PortRange[]

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

clientAffinityOptionalinherited from ListenerOptions
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 separate endpoints. Set client affinity to SOURCE_IP to route all connections from a single client to the same endpoint.

Default: ClientAffinity.NONE

listenerNameOptionalinherited from ListenerOptions
string

Name of the listener.

Default: - logical ID of the resource

protocolOptionalinherited from ListenerOptions
ConnectionProtocol

The protocol for the connections from clients to the accelerator.

Default: ConnectionProtocol.TCP

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter