associateMacSecKey method
Associates a MAC Security (MACsec) Connection Key Name (CKN)/ Connectivity Association Key (CAK) pair with a Direct Connect connection.
You must supply either the secretARN, or the CKN/CAK
(ckn and cak) pair in the request.
For information about MAC Security (MACsec) key considerations, see MACsec pre-shared CKN/CAK key considerations in the Direct Connect User Guide.
May throw DirectConnectClientException.
May throw DirectConnectServerException.
Parameter connectionId :
The ID of the dedicated connection (dxcon-xxxx), interconnect
(dxcon-xxxx), or LAG (dxlag-xxxx).
You can use DescribeConnections, DescribeInterconnects, or DescribeLags to retrieve connection ID.
Parameter cak :
The MAC Security (MACsec) CAK to associate with the connection.
You can create the CKN/CAK pair using an industry standard tool.
The valid values are 64 hexadecimal characters (0-9, A-E).
If you use this request parameter, you must use the ckn
request parameter and not use the secretARN request
parameter.
Parameter ckn :
The MAC Security (MACsec) CKN to associate with the connection.
You can create the CKN/CAK pair using an industry standard tool.
The valid values are 64 hexadecimal characters (0-9, A-E).
If you use this request parameter, you must use the cak
request parameter and not use the secretARN request
parameter.
Parameter secretARN :
The Amazon Resource Name (ARN) of the MAC Security (MACsec) secret key to
associate with the connection.
You can use DescribeConnections or DescribeLags to retrieve the MAC Security (MACsec) secret key.
If you use this request parameter, you do not use the ckn and
cak request parameters.
Implementation
Future<AssociateMacSecKeyResponse> associateMacSecKey({
required String connectionId,
String? cak,
String? ckn,
String? secretARN,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'OvertureService.AssociateMacSecKey'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'connectionId': connectionId,
if (cak != null) 'cak': cak,
if (ckn != null) 'ckn': ckn,
if (secretARN != null) 'secretARN': secretARN,
},
);
return AssociateMacSecKeyResponse.fromJson(jsonResponse.body);
}