Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli atlas clusters create

On this page

  • Syntax
  • Arguments
  • Options
  • Inherited Options
  • Examples

Create a MongoDB cluster for your project.

You can create MongoDB clusters using this command. To quickest way to get started is to just specify a name for your cluster and cloud provider and region to deploy, this will create a 3 member replica set with the latest available mongodb server version available. Some of the cluster configuration options are available via flags but for full control of your deployment you can provide a config file.

mongocli atlas clusters create [name] [options]
Name
Type
Required
Description
name
string
false
Name of the cluster. The cluster name cannot be changed after the cluster is created. Cluster name can contain ASCII letters, numbers, and hyphen.
Name
Type
Required
Description
--backup
false
If true, enables Continuous Cloud Backup for your cluster.
--biConnector
false
If true, enables BI Connector for Atlas on the cluster.
--diskSizeGB
float
false
Capacity, in gigabytes, of the host’s root volume. (default 2)
-f, --file
string
false
Filename to use, optional file with a json cluster configuration.
-h, --help
false
help for create
--mdbVersion
string
false
MongoDB version of the cluster to deploy. (default "4.4")
-m, --members
int
false
Number of members in the replica set. (default 3)
-o, --output
string
false
Output format. Valid values: json|json-path|go-template|go-template-file
--projectId
string
false
Project ID to use. Overrides configuration file or environment variable settings.
--provider
string
false
Name of your cloud service provider. Valid values: AWS|AZURE|GCP.
-r, --region
string
false
Physical location of your MongoDB cluster. For a complete list of supported AWS regions, see: https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws For a complete list of supported Azure regions, see: https://docs.atlas.mongodb.com/reference/microsoft-azure/#microsoft-azure For a complete list of supported GCP regions, see: https://docs.atlas.mongodb.com/reference/google-gcp/#google-gcp
-s, --shards
int
false
Number of shards in the cluster. (default 1)
--tier
string
false
Tier for each data-bearing server in the cluster. (default "M2")
--type
string
false
Type of the cluster that you want to create. Valid values: REPLICASET|SHARDED. (default "REPLICASET")
Name
Type
Required
Description
-P, --profile
string
false
Profile to use from your configuration file.
Deploy a 3 members replica set in AWS
$ mongocli atlas cluster create <clusterName> --projectId <projectId> --provider AWS --region US_EAST_1 --members 3 --tier M10 --mdbVersion 4.2 --diskSizeGB 10
Deploy a 3 members replica set in AZURE
$ mongocli atlas cluster create <clusterName> --projectId <projectId> --provider AZURE --region US_EAST_2 --members 3 --tier M10 --mdbVersion 4.2 --diskSizeGB 10
Deploy a 3 members replica set in GCP
$ mongocli atlas cluster create <clusterName> --projectId <projectId> --provider GCP --region EASTERN_US --members 3 --tier M10 --mdbVersion 4.2 --diskSizeGB 10
Deploy a cluster from a config file
$ mongocli atlas cluster create --projectId <projectId> --file <path/to/cluster.json>

Auto generated by MongoDB CLI on 8-Jul-2021

Back

describe