Fix This Page
Navigation

Create a New Container

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

Syntax

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

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
atlasCidrBlock Required.

Atlas CIDR block.

The Atlas CIDR block must be a /21 in one of the following private networks.

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16
providerName Required. The provider name. Specify AWS.
regionName Required. AWS region name.

HTTP Response Elements

Field Description
id The container ID.
providerName Provider name; e.g. AWS.
atlasCidrBlock The Atlas CIDR block.
regionName AWS region.
vpcId The ID of the peer VPC.
isProvisioned Flag that indicates if the group has clusters deployed in the VPC.

Example Request

curl -X POST -u 'username:apiKey' --digest "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/containers" \
   -H "Content-Type: application/json" --data '
   {
       "atlasCidrBlock" : "192.168.248.0/21",
       "providerName" : "AWS",
       "regionName" : "US_EAST_1"
   }'

Example Response

{
  "atlasCidrBlock" : "192.168.248.0/21",
  "id" : "1112269b3bf99403840e8934",
  "providerName" : "AWS",
  "provisioned" : true,
  "regionName" : "US_EAST_1",
  "vpcId" : "vpc-zz0zzzzz"
}