Fix This Page
Navigation

Create a New VPC Peering Connection

Base URL: https://cloud.mongodb.com/

Syntax

POST /api/atlas/v1.0/groups/{GROUP-ID}/peers

Request Path Parameters

Parameter Required/Optional Description
GROUP-ID Required. The unique identifier for the group.

Request Query Parameters

Field Required/Optional Description
envelope Optional. A boolean that specifies whether or not to wrap the response in an envelope.

Request Body Parameters

Parameter Required/Optional Description
vpcId Required. The ID of the peer VPC.
awsAccountId Required. The AWS account ID of the owner of the peer VPC.
routeTableCidrBlock Required. The peer VPC CIDR block or subnet.

HTTP Response Elements

Field Description
id Atlas assigned unique ID for the connection. Only specific to and used by Atlas.
routeTableCidrBlock The peer VPC CIDR block or subnet.
vpcId The ID of the peer VPC.
awsAccountId The AWS account ID of the owner of the peer VPC.
connectionId The peering connection ID.
statusName

The status.

The VPC peering connection status value can be one of the following:

  • INITIATING
  • PENDING_ACCEPTANCE
  • FAILED
  • FINALIZING
  • AVAILABLE
  • TERMINATING
errorStateName

The error state, if any.

The VPC peering connection error state value can be one of the following:

  • REJECTED
  • EXPIRED
  • INVALID_ARGUMENT

Example Request

curl -X POST -u 'username:apiKey' --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/peers" \
   -H "Content-Type: application/json" --data '
   {
       "vpcId" : "vpc-123456",
       "awsAccountId" : "abc123abc123",
       "routeTableCidrBlock" : "192.168.0.0/24"
   }'

Example Response

{
   "awsAccountId" : "999900000000",
   "connectionId" : null,
   "errorStateName" : null,
   "id" : "1112222b3bf99403840e8934",
   "routeTableCidrBlock" : "10.15.0.0/16",
   "statusName" : "INITIATING",
   "vpcId" : "vpc-abc123abc123"
}