createConnection method
Creates a connection between a customer network and a specific Direct Connect location.
A connection links your internal network to an Direct Connect location over a standard Ethernet fiber-optic cable. One end of the cable is connected to your router, the other to an Direct Connect router.
To find the locations for your Region, use DescribeLocations.
You can automatically add the new connection to a link aggregation group (LAG) by specifying a LAG ID in the request. This ensures that the new connection is allocated on the same Direct Connect endpoint that hosts the specified LAG. If there are no available ports on the endpoint, the request fails and no connection is created.
May throw DirectConnectClientException.
May throw DirectConnectServerException.
May throw DuplicateTagKeysException.
May throw TooManyTagsException.
Parameter bandwidth :
The bandwidth of the connection.
Parameter connectionName :
The name of the connection.
Parameter location :
The location of the connection.
Parameter lagId :
The ID of the LAG.
Parameter providerName :
The name of the service provider associated with the requested connection.
Parameter requestMACSec :
Indicates whether you want the connection to support MAC Security
(MACsec).
MAC Security (MACsec) is unavailable on hosted connections. For information about MAC Security (MACsec) prerequisites, see MAC Security in Direct Connect in the Direct Connect User Guide.
Parameter tags :
The tags to associate with the lag.
Implementation
Future<Connection> createConnection({
required String bandwidth,
required String connectionName,
required String location,
String? lagId,
String? providerName,
bool? requestMACSec,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'OvertureService.CreateConnection'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'bandwidth': bandwidth,
'connectionName': connectionName,
'location': location,
if (lagId != null) 'lagId': lagId,
if (providerName != null) 'providerName': providerName,
if (requestMACSec != null) 'requestMACSec': requestMACSec,
if (tags != null) 'tags': tags,
},
);
return Connection.fromJson(jsonResponse.body);
}