Currently, within the Create a New VPC Peering Connection : Request Body Parameters section of the Atlas documentation, the following required parameters are depicted:
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.
However, since the most recent Atlas release, an additional parameter is required when calling this API endpoint: containerId.
As an example, when attempting to call this API endpoint sans-containerId:
Unable to find source-code formatter for language: request. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
curl -X POST -u "$ATLAS_USERNAME:$ATLAS_API_KEY" --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/$ATLAS_PROJECT_ID/peers?pretty=true" \ -H "Content-Type: application/json" --data ' { "vpcId" : "$AWS_VPC_ID", "awsAccountId" : "$AWS_ACCOUNT_ID", "routeTableCidrBlock" : "10.0.128.0/17" }'
The following response is received:
{ "detail" : "The required attribute containerId was not specified.", "error" : 400, "errorCode" : "MISSING_ATTRIBUTE", "parameters" : [ "containerId" ], "reason" : "Bad Request" }
The containerId can be obtained via the Get a List of Cloud Services Containers API endpoint (returned as the id response element).
Ideally, the Create a New VPC Peering Connection : Request Body Parameters section of the Atlas documentation should be updated to include containerId as a required parameter.