Fix This Page
Navigation

Create a Cluster

Note

This feature is not available for Free Tier clusters. For more information, see Atlas M0 (Free Tier) Limitations.

The Atlas API uses HTTP Digest Authentication. Provide your Atlas username as the username and group API key as the password as part of the HTTP request.

For complete documentation on configuring API access for an Atlas group, see Configure Atlas API Access.

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

Syntax

POST /api/atlas/v1.0/groups/GROUP-ID/clusters

Request Path Parameters

Path Element Required/Optional Description
GROUP-ID Required. The unique identifier for the group in which to create the cluster.

Request Body Parameters

Name Type Required/Optional Description
name string Required The name of the cluster as it appears in Atlas. Once the cluster is created, its name cannot be changed.
mongoDBMajorVersion string Required

The version of the cluster to deploy. Atlas supports the following MongoDB versions:

  • 3.2
  • 3.4

Atlas always deploys the cluster with the latest stable release of the specified version.

numShards integer Optional

Selects whether the cluster is a replica set or a sharded cluster.

If this is set to 1, the cluster is a replica set. For more information on MongoDB replica sets, see Replication in the MongoDB manual.

If this is set to 2 or higher, the cluster is a sharded cluster with the number of shards specified. For more information on sharded clusters, see Sharding in the MongoDB manual.

For details on how this setting affects costs, see Number of Servers.

The possible values are 1 through 12.

The default value is 1.

replicationFactor number Optional

The number of replica set members. Each member keeps a copy of your databases, providing high availability and data redundancy.

If your cluster is a sharded cluster, each shard is a replica set with the specified replication factor.

For information on how the replication factor affects costs, see Number of Servers. For more information on MongoDB replica sets, see Replication in the MongoDB manual.

The possible values are 3, 5, or 7.

The default value is 3.

providerSettings object Required The configuration for the provisioned servers on which MongoDB runs. The available options are specific to the cloud service provider.
providerSettings.providerName string Required

The cloud service provider on which the servers are provisioned.

Atlas currently integrates with Amazon Web Services (AWS). This field must be set to AWS until other integrations become available.

providerSettings.regionName string Required

The physical location of your MongoDB cluster. The region you choose can affect network latency for clients accessing your databases.

The region selected for the first cluster in the Atlas group determines the region for all clusters in that group. This is because a region-specific Virtual Private Cloud (VPC) is created for the Atlas group during the deployment of the group’s first cluster.

For AWS, Atlas currently supports the following regions:

  • ‘US_EAST_1’
  • ‘US_EAST_2’
  • ‘US_WEST_1’
  • ‘US_WEST_2’
  • ‘CA_CENTRAL_1’
  • ‘EU_WEST_1’
  • ‘EU_WEST_2’
  • ‘EU_CENTRAL_1’
  • ‘AP_NORTHEAST_1’
  • ‘AP_NORTHEAST_2’
  • ‘AP_SOUTHEAST_1’
  • ‘AP_SOUTHEAST_2’
  • ‘AP_SOUTH_1’
  • ‘SA_EAST_1’
providerSettings.instanceSizeName string Required

Atlas provides different instance sizes, each with a default RAM size, storage capacity, and maximum storage speed. The instance size you select is used for all the data-bearing servers in your cluster. For definitions of data-bearing servers, see Number of Servers.

You can customize the instance size using the diskSizeGB and providerSettings.diskIOPS fields. Doing so affects costs, as described in Billing.

In the API, enter the instance size exactly as it is named in the interface. For example, for M40 enter M40.

To view available instance sizes: open the Atlas web interface; view an existing configuration or click the button to add a new one; view the available instance sizes; close the window without saving changes.

providerSettings.diskIOPS integer Optional

The maximum input/output operations per second (IOPS) the system can perform. The available IOPS depend on the instance size: each instance size has a specific set of available IOPS values. To view available values, use the Atlas interface to either view an existing configuration or add a new one; then click an instance size to view the available values; and then close the configuration without saving changes.

The default value for providerSettings.diskIOPS is the same as the instance size’s Standard IOPS value, as viewable in the Atlas interface.

providerSettings.encryptEBSVolume Boolean Optional

AWS only. If enabled, the Amazon EBS encryption feature encrypts the server’s root volume for both data at rest within the volume and for data moving between the volume and the instance.

The default value is false.

diskSizeGB double Optional

The size in gigabytes of the server’s root volume. You can add capacity by increasing this number, up to a maximum possible value of 16384 (i.e., 16 TB).

Each instance size has its own default value. If you set a value below the instance default, Atlas replaces it with the default value. To view default values: open the Atlas web interface; click the button to add a new cluster; view the available default sizes; close the window without saving changes.

Important

Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. For details, see Storage Capacity.

backupEnabled Boolean Required If enabled, the Atlas Backup service takes snapshots of your databases at regular intervals and retains them according to your group’s retention policy.

HTTP Response Elements

Name Type Description
name string The name of the cluster as it appears in Atlas.
groupId string ID of the group the cluster belongs to.
mongoDBVersion string The version of MongoDB the cluster runs, in <major version>.<minor version> format.
mongoDBMajorVersion string

The major version of MongoDB the cluster runs. Atlas supports the following MongoDB versions:

  • 3.2
  • 3.4
mongoURI string

The connection string for connecting to the cluster through a MongoDB driver or the mongo shell. To download the mongo shell, click a cluster’s Connect button and follow the download instructions.

When you create a new cluster, the mongoURI will not show up while the cluster is being built. Atlas provides the connection string only after the cluster is running.

mongoURIUpdated string Lists when the connection string was last updated. The connection string changes, for example, if you change a replica set to a sharded cluster.
numShards integer

Selects whether the cluster is a sharded cluster or a replica set and specifies the number of shards for a sharded cluster.

If this is set to 1, the cluster is a replica set. For more information on MongoDB replica sets, see Replication in the MongoDB manual.

If this is set to 2 or higher, the cluster is a sharded cluster with the number of shards specified. For more information on sharded clusters, see Sharding in the MongoDB manual.

For details on how this setting affects costs, see Number of Servers.

The possible values are 1 through 12.

replicationFactor number

The number of replica set members. Each member keeps a copy of your databases, providing high availability and data redundancy.

If your cluster is a sharded cluster, each shard is a replica set with the specified replication factor.

For information on how the replication factor affects costs, see Number of Servers. For more information on MongoDB replica sets, see Replication in the MongoDB manual.

The possible values are 3, 5, or 7.

providerSettings object The configuration for the provisioned servers on which MongoDB runs. The available options are specific to the cloud service provider.
providerSettings.providerName string

The cloud service provider on which the servers are provisioned.

Atlas currently integrates with Amazon Web Services (AWS). This field value is AWS until other integrations become available.

providerSettings.regionName string

The physical location of your MongoDB cluster. The region you choose can affect network latency for clients accessing your databases.

The region selected for the first cluster in the Atlas group determines the region for all clusters in that group. This is because a region-specific Virtual Private Cloud (VPC) is created for the Atlas group during the deployment of the group’s first cluster.

For AWS, Atlas currently supports the following regions:

  • ‘US_EAST_1’
  • ‘US_EAST_2’
  • ‘US_WEST_1’
  • ‘US_WEST_2’
  • ‘CA_CENTRAL_1’
  • ‘EU_WEST_1’
  • ‘EU_WEST_2’
  • ‘EU_CENTRAL_1’
  • ‘AP_NORTHEAST_1’
  • ‘AP_NORTHEAST_2’
  • ‘AP_SOUTHEAST_1’
  • ‘AP_SOUTHEAST_2’
  • ‘AP_SOUTH_1’
  • ‘SA_EAST_1’
providerSettings.instanceSizeName string

The name of the instance size used for the Atlas cluster.

To view available instance sizes: open the Atlas web interface; view an existing configuration or click the button to add a new one; view the available instance sizes; close the window without saving changes.

providerSettings.diskIOPS integer The maximum input/output operations per second (IOPS) the system can perform. The available IOPS depend on the instance size: each instance size has a specific set of available IOPS values. To view available values, use the Atlas interface to either view an existing configuration or add a new one; then click an instance size to view the available values; and then close the configuration without saving changes.
providerSettings.encryptEBSVolume Boolean AWS only. If enabled, the Amazon EBS encryption feature encrypts the server’s root volume for both data at rest within the volume and for data moving between the volume and the instance.
diskSizeGB double

The size in gigabytes of the server’s root volume. You can add capacity by increasing this number, up to a maximum possible value of 16384 (i.e., 16 TB).

Each instance size has its own default value. To view default values: open the Atlas web interface; click the button to add a new cluster; view the available default sizes; close the window without saving changes.

backupEnabled Boolean If enabled, the Atlas Backup service takes snapshots of your databases at regular intervals and retains them according to your group’s retention policy.
stateName string

The current state of the cluster. The possible states are:

  • IDLE
  • CREATING
  • UPDATING
  • DELETING
  • DELETED
  • REPAIRING

Example

Request

curl -u "username:apiKey" --digest -H "Content-Type: application/json" -X POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794de37132bb7b/clusters" --data '
{
  "name" : "DataStore2",
  "diskSizeGB" : 160,
  "numShards" : 1,
  "providerSettings" : {
    "providerName" : "AWS",
    "diskIOPS" : 480,
    "encryptEBSVolume" : false,
    "instanceSizeName" : "M40",
    "regionName" : "US_EAST_1"
  },
  "replicationFactor" : 3,
  "backupEnabled" : true
}'

Response

{
   "backupEnabled" : true,
   "diskSizeGB" : 160,
   "groupId" : "5356823b3794de37132bb7b",
   "links" : [
      {
         "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794de37132bb7b/clusters/DataStore2",
         "rel" : "self"
      }
   ],
   "mongoDBMajorVersion" : "3.4",
   "mongoDBVersion" : "3.4.3",
   "mongoURIUpdated" : "2017-04-14T15:02:33Z",
   "name" : "DataStore2",
   "numShards" : 1,
   "providerSettings" : {
      "providerName" : "AWS",
      "diskIOPS" : 480,
      "encryptEBSVolume" : false,
      "instanceSizeName" : "M40",
      "regionName" : "US_EAST_1"
   },
   "replicationFactor" : 3,
   "stateName" : "CREATING"
}