createLag method

Future<Lag> createLag({
  1. required String connectionsBandwidth,
  2. required String lagName,
  3. required String location,
  4. required int numberOfConnections,
  5. List<Tag>? childConnectionTags,
  6. String? connectionId,
  7. String? providerName,
  8. List<Tag>? tags,
})

Creates a link aggregation group (LAG) with the specified number of bundled physical dedicated connections between the customer network and a specific AWS Direct Connect location. A LAG is a logical interface that uses the Link Aggregation Control Protocol (LACP) to aggregate multiple interfaces, enabling you to treat them as a single interface.

All connections in a LAG must use the same bandwidth (either 1Gbps or 10Gbps) and must terminate at the same AWS Direct Connect endpoint.

You can have up to 10 dedicated connections per LAG. Regardless of this limit, if you request more connections for the LAG than AWS Direct Connect can allocate on a single endpoint, no LAG is created.

You can specify an existing physical dedicated connection or interconnect to include in the LAG (which counts towards the total number of connections). Doing so interrupts the current physical dedicated connection, and re-establishes them as a member of the LAG. The LAG will be created on the same AWS Direct Connect endpoint to which the dedicated connection terminates. Any virtual interfaces associated with the dedicated connection are automatically disassociated and re-associated with the LAG. The connection ID does not change.

If the AWS account used to create a LAG is a registered AWS Direct Connect Partner, the LAG is automatically enabled to host sub-connections. For a LAG owned by a partner, any associated virtual interfaces cannot be directly configured.

May throw DuplicateTagKeysException. May throw TooManyTagsException. May throw DirectConnectServerException. May throw DirectConnectClientException.

Parameter connectionsBandwidth : The bandwidth of the individual physical dedicated connections bundled by the LAG. The possible values are 1Gbps and 10Gbps.

Parameter lagName : The name of the LAG.

Parameter location : The location for the LAG.

Parameter numberOfConnections : The number of physical dedicated connections initially provisioned and bundled by the LAG.

Parameter childConnectionTags : The tags to associate with the automtically created LAGs.

Parameter connectionId : The ID of an existing dedicated connection to migrate to the LAG.

Parameter providerName : The name of the service provider associated with the LAG.

Parameter tags : The tags to associate with the LAG.

Implementation

Future<Lag> createLag({
  required String connectionsBandwidth,
  required String lagName,
  required String location,
  required int numberOfConnections,
  List<Tag>? childConnectionTags,
  String? connectionId,
  String? providerName,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(connectionsBandwidth, 'connectionsBandwidth');
  ArgumentError.checkNotNull(lagName, 'lagName');
  ArgumentError.checkNotNull(location, 'location');
  ArgumentError.checkNotNull(numberOfConnections, 'numberOfConnections');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.CreateLag'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'connectionsBandwidth': connectionsBandwidth,
      'lagName': lagName,
      'location': location,
      'numberOfConnections': numberOfConnections,
      if (childConnectionTags != null)
        'childConnectionTags': childConnectionTags,
      if (connectionId != null) 'connectionId': connectionId,
      if (providerName != null) 'providerName': providerName,
      if (tags != null) 'tags': tags,
    },
  );

  return Lag.fromJson(jsonResponse.body);
}