createBGPPeer method

Future<CreateBGPPeerResponse> createBGPPeer({
  1. NewBGPPeer? newBGPPeer,
  2. String? virtualInterfaceId,
})

Creates a BGP peer on the specified virtual interface.

You must create a BGP peer for the corresponding address family (IPv4/IPv6) in order to access AWS resources that also use that address family.

If logical redundancy is not supported by the connection, interconnect, or LAG, the BGP peer cannot be in the same address family as an existing BGP peer on the virtual interface.

When creating a IPv6 BGP peer, omit the Amazon address and customer address. IPv6 addresses are automatically assigned from the Amazon pool of IPv6 addresses; you cannot specify custom IPv6 addresses.

For a public virtual interface, the Autonomous System Number (ASN) must be private or already whitelisted for the virtual interface.

May throw DirectConnectServerException. May throw DirectConnectClientException.

Parameter newBGPPeer : Information about the BGP peer.

Parameter virtualInterfaceId : The ID of the virtual interface.

Implementation

Future<CreateBGPPeerResponse> createBGPPeer({
  NewBGPPeer? newBGPPeer,
  String? virtualInterfaceId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OvertureService.CreateBGPPeer'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (newBGPPeer != null) 'newBGPPeer': newBGPPeer,
      if (virtualInterfaceId != null)
        'virtualInterfaceId': virtualInterfaceId,
    },
  );

  return CreateBGPPeerResponse.fromJson(jsonResponse.body);
}