CreateCustomRoutingListenerCommand

Create a listener to process inbound connections from clients to a custom routing accelerator. Connections arrive to assigned static IP addresses on the port range that you specify.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlobalAcceleratorClient, CreateCustomRoutingListenerCommand } from "@aws-sdk/client-global-accelerator"; // ES Modules import
// const { GlobalAcceleratorClient, CreateCustomRoutingListenerCommand } = require("@aws-sdk/client-global-accelerator"); // CommonJS import
const client = new GlobalAcceleratorClient(config);
const input = { // CreateCustomRoutingListenerRequest
  AcceleratorArn: "STRING_VALUE", // required
  PortRanges: [ // PortRanges // required
    { // PortRange
      FromPort: Number("int"),
      ToPort: Number("int"),
    },
  ],
  IdempotencyToken: "STRING_VALUE", // required
};
const command = new CreateCustomRoutingListenerCommand(input);
const response = await client.send(command);
// { // CreateCustomRoutingListenerResponse
//   Listener: { // CustomRoutingListener
//     ListenerArn: "STRING_VALUE",
//     PortRanges: [ // PortRanges
//       { // PortRange
//         FromPort: Number("int"),
//         ToPort: Number("int"),
//       },
//     ],
//   },
// };

CreateCustomRoutingListenerCommand Input

Parameter
Type
Description
AcceleratorArn
Required
string | undefined

The Amazon Resource Name (ARN) of the accelerator for a custom routing listener.

PortRanges
Required
PortRange[] | undefined

The port range to support for connections from clients to your accelerator.

Separately, you set port ranges for endpoints. For more information, see About endpoints for custom routing accelerators .

IdempotencyToken
string | undefined

A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.

CreateCustomRoutingListenerCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Listener
CustomRoutingListener | undefined

The listener that you've created for a custom routing accelerator.

Throws

Name
Fault
Details
AcceleratorNotFoundException
client

The accelerator that you specified doesn't exist.

InternalServiceErrorException
server

There was an internal error for Global Accelerator.

InvalidArgumentException
client

An argument that you specified is invalid.

InvalidPortRangeException
client

The port numbers that you specified are not valid numbers or are not unique for this accelerator.

LimitExceededException
client

Processing your request would cause you to exceed an Global Accelerator limit.

GlobalAcceleratorServiceException
Base exception class for all service exceptions from GlobalAccelerator service.