createConnectPeer method
Creates a core network Connect peer for a specified core network connect attachment between a core network and an appliance. The peer address and transit gateway address must be the same IP address family (IPv4 or IPv6).
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter connectAttachmentId :
The ID of the connection attachment.
Parameter peerAddress :
The Connect peer address.
Parameter bgpOptions :
The Connect peer BGP options. This only applies only when the protocol is
GRE.
Parameter clientToken :
The client token associated with the request.
Parameter coreNetworkAddress :
A Connect peer core network address. This only applies only when the
protocol is GRE.
Parameter insideCidrBlocks :
The inside IP addresses used for BGP peering.
Parameter subnetArn :
The subnet ARN for the Connect peer. This only applies only when the
protocol is NO_ENCAP.
Parameter tags :
The tags associated with the peer request.
Implementation
Future<CreateConnectPeerResponse> createConnectPeer({
required String connectAttachmentId,
required String peerAddress,
BgpOptions? bgpOptions,
String? clientToken,
String? coreNetworkAddress,
List<String>? insideCidrBlocks,
String? subnetArn,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'ConnectAttachmentId': connectAttachmentId,
'PeerAddress': peerAddress,
if (bgpOptions != null) 'BgpOptions': bgpOptions,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (coreNetworkAddress != null) 'CoreNetworkAddress': coreNetworkAddress,
if (insideCidrBlocks != null) 'InsideCidrBlocks': insideCidrBlocks,
if (subnetArn != null) 'SubnetArn': subnetArn,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/connect-peers',
exceptionFnMap: _exceptionFns,
);
return CreateConnectPeerResponse.fromJson(response);
}