addCustomRoutingEndpoints method

Future<AddCustomRoutingEndpointsResponse> addCustomRoutingEndpoints({
  1. required List<CustomRoutingEndpointConfiguration> endpointConfigurations,
  2. required String endpointGroupArn,
})

Associate a virtual private cloud (VPC) subnet endpoint with your custom routing accelerator.

The listener port range must be large enough to support the number of IP addresses that can be specified in your subnet. The number of ports required is: subnet size times the number of ports per destination EC2 instances. For example, a subnet defined as /24 requires a listener port range of at least 255 ports.

Note: You must have enough remaining listener ports available to map to the subnet ports, or the call will fail with a LimitExceededException.

By default, all destinations in a subnet in a custom routing accelerator cannot receive traffic. To enable all destinations to receive traffic, or to specify individual port mappings that can receive traffic, see the AllowCustomRoutingTraffic operation.

May throw EndpointAlreadyExistsException. May throw EndpointGroupNotFoundException. May throw InternalServiceErrorException. May throw InvalidArgumentException. May throw LimitExceededException. May throw AccessDeniedException. May throw ConflictException.

Parameter endpointConfigurations : The list of endpoint objects to add to a custom routing accelerator.

Parameter endpointGroupArn : The Amazon Resource Name (ARN) of the endpoint group for the custom routing endpoint.

Implementation

Future<AddCustomRoutingEndpointsResponse> addCustomRoutingEndpoints({
  required List<CustomRoutingEndpointConfiguration> endpointConfigurations,
  required String endpointGroupArn,
}) async {
  ArgumentError.checkNotNull(
      endpointConfigurations, 'endpointConfigurations');
  ArgumentError.checkNotNull(endpointGroupArn, 'endpointGroupArn');
  _s.validateStringLength(
    'endpointGroupArn',
    endpointGroupArn,
    0,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GlobalAccelerator_V20180706.AddCustomRoutingEndpoints'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndpointConfigurations': endpointConfigurations,
      'EndpointGroupArn': endpointGroupArn,
    },
  );

  return AddCustomRoutingEndpointsResponse.fromJson(jsonResponse.body);
}