Skip to content

Listener

Source: src/AWS/GlobalAccelerator/Listener.ts

A Global Accelerator listener that accepts inbound client connections on an accelerator’s static IP addresses, on one or more port ranges.

Port ranges, protocol, and client affinity are all updatable in place; only moving the listener to a different accelerator replaces it. Attach EndpointGroups to route the accepted traffic to regional endpoints.

TCP Listener

const listener = yield* GlobalAccelerator.Listener("Web", {
acceleratorArn: accelerator.acceleratorArn,
portRanges: [{ fromPort: 80, toPort: 80 }],
protocol: "TCP",
});

Sticky UDP Listener with Multiple Port Ranges

const listener = yield* GlobalAccelerator.Listener("Game", {
acceleratorArn: accelerator.acceleratorArn,
portRanges: [
{ fromPort: 3000, toPort: 3100 },
{ fromPort: 4000, toPort: 4000 },
],
protocol: "UDP",
clientAffinity: "SOURCE_IP",
});