Documentation Index

Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

createCloudMongoDbInstance

Prev Next

Available in VPC

Creates a Cloud DB for MongoDB instance.

Syntax

The createCloudMongoDbInstance syntax is as follows:

./ncloud vmongodb createCloudMongoDbInstance \
    --vpcNo <vpc-no> \
    --subnetNo <subnet-no> \
    --cloudMongoDbServiceName <service-name> \
    --cloudMongoDbServerNamePrefix <server-name-prefix> \
    --clusterTypeCode <STAND_ALONE|SINGLE_REPLICA_SET|SHARDED_CLUSTER> \
    --cloudMongoDbUserName <user-name> \
    --cloudMongoDbUserPassword <user-password> \
    [--cloudMongoDbImageProductCode <image-product-code>] \
    [--memberProductCode <member-product-code>] \
    [--arbiterProductCode <arbiter-product-code>] \
    [--mongosProductCode <mongos-product-code>] \
    [--configProductCode <config-product-code>] \
    [--shardCount <shard-count>] \
    [--memberServerCount <member-server-count>] \
    [--arbiterServerCount <arbiter-server-count>] \
    [--mongosServerCount <mongos-server-count>] \
    [--configServerCount <config-server-count>] \
    [--engineVersionCode <engine-version-code>] \    
    [--dataStorageTypeCode <SSD|HDD|CB2>] \
    [--compressCode <SNPP|ZLIB|ZSTD|NONE>] \
    [--memberPort <member-port>] \
    [--mongosPort <mongos-port>] \
    [--configPort <config-port>] \
    [--backupTime <hh:mm>] \    
    [--backupFileRetentionPeriod <retention-days>] \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running createCloudMongoDbInstance.

Required options

The following options are required for createCloudMongoDbInstance.

Options Type Required Description
--vpcNo String Required Number of VPC to create the Cloud DB for MongoDB instance in
--subnetNo String Required Subnet number of the default network interface to be used in the Cloud DB for MongoDB instance
  • Subscription to public domains can only be done in a DB server created in public subnet.
  • Subnet migrations are not available after creating the Cloud DB for MongoDB instance.
  • See getCloudMongoDbTargetSubnetList.
--cloudMongoDbServiceName String Required Cloud DB for MongoDB service name
  • Enter 3-15 characters, including lowercase English letters, Korean letters, numbers, and special character -.
--cloudMongoDbServerNamePrefix String Required Prefix for the Cloud DB for MongoDB server name
  • Enter 3-15 characters, including lowercase English letters, numbers, and special character -.
  • The string must begin with an English letter and end with an English letter or number.
  • It is created by adding random text to avoid duplicated host names.
  • e.g., If the prefix is test: mg-test-a000-123a.
--clusterTypeCode String Required Cluster type code of the Cloud DB for MongoDB instance
  • STAND_ALONE | SINGLE_REPLICA_SET | SHARDED_CLUSTER
--cloudMongoDbUserName String Required DB user account ID
  • Enter 4-16 characters, including English letters, numbers, and special character _.
  • The string must begin with an English letter.
--cloudMongoDbUserPassword String Required DB user account password
  • Enter 8-20 characters containing at least one English letter, number, and special character.
  • Special characters ` & + \ " ' / and spaces can't be used.

Optional options

These are the optional options for createCloudMongoDbInstance. Options that are not specified will use their default values.

Options Type Required Description
--cloudMongoDbImageProductCode String Optional Cloud DB for MongoDB image product code
--memberProductCode String Optional Cloud DB for MongoDB member server product code
  • Default: Minimum specifications (in the order of memory, CPU).
  • When calling getCloudMongoDbProductList, set infraResourceDetailTypeCode to MNGOD to verify.
--arbiterProductCode String Optional Cloud DB for MongoDB arbiter server product code
  • Default: Minimum specifications (in the order of memory, CPU).
  • When calling getCloudMongoDbProductList, set infraResourceDetailTypeCode to ARBIT to verify.
--mongosProductCode String Optional Cloud DB for MongoDB mongos server product code
  • Default: Minimum specifications (in the order of memory, CPU).
  • When calling getCloudMongoDbProductList, set infraResourceDetailTypeCode to MNGOS to verify.
--configProductCode String Optional Cloud DB for MongoDB config server product code
  • Default: Minimum specifications (in the order of memory, CPU).
  • When calling getCloudMongoDbProductList, set infraResourceDetailTypeCode to CFGSV to verify.
--shardCount Integer Optional Number of Cloud DB for MongoDB shards
  • 2-3 (default: 2)
  • Can be entered only if clusterTypeCode is SHARDED_CLUSTER.
  • Configurable if sharding is enabled, initial configuration limited to two or three.
--memberServerCount Integer Optional Number of Cloud DB for MongoDB member servers
  • 2-7 (default: 3)
  • You can select the number of member servers per replica set (or per shard in the case of sharding).
  • You can create between 3 to 7, including arbiter servers.
--arbiterServerCount Integer Optional Number of Cloud DB for MongoDB arbiter servers
  • 0-1 (default: 0)
  • You can select whether to use an arbiter server per replica set (or per shard in the case of sharding).
  • You can only select a maximum of one arbiter server.
  • Arbiter servers are provided with the minimum configurable specifications.
--mongosServerCount Integer Optional Number of Cloud DB for MongoDB mongos servers
  • 2-5 (default: 2)
  • When using sharding, you can select the number of mongos servers.
--configServerCount Integer Optional Number of Cloud DB for MongoDB config servers
  • 3 (default)
  • When using sharding, you can select the number of config servers.
--engineVersionCode String Optional DB engine version
--dataStorageTypeCode String Optional Data storage type code
  • Valid values vary depending on the generationCode of cloudMongoDbImageProductCode.
    • G2: SSD (default) | HDD
    • G3: CB2 (default)
  • You cannot change the data storage type after creating a Cloud DB for MongoDB instance.
--compressCode String Optional Data compression algorithm code of the Cloud DB for MongoDB instance
  • SNPP (default) | ZLIB | ZSTD | NONE
    • SNPP: Snappy
    • ZLIB: Zlib
    • ZSTD: Zstd
    • NONE: None
  • Using the default is recommended.
--memberPort Integer Optional TCP port number for the Cloud DB for MongoDB member server access
  • 10000-65535 (default: 17017)
  • 27017, which is the default port number, is not recommended for use due to its security vulnerabilities.
--mongosPort Integer Optional TCP port number for the Cloud DB for MongoDB mongos server access
  • 10000-65535 (default: 17017)
  • 27017, which is the default port number, is not recommended for use due to its security vulnerabilities.
--configPort Integer Optional TCP port number for the Cloud DB for MongoDB config server access
  • 10000-65535 (default: 17017)
  • 27017, which is the default port number, is not recommended for use due to its security vulnerabilities.
--backupTime String Optional Set backup time (HH:MM).
  • 02:00 (default)
  • Enter in 15 minute increments.
--backupFileRetentionPeriod Integer Optional Backup file retention period (days)
  • 1-30 (default: 1)
  • Backup is performed every day, and the backup file is stored in a separate backup storage.
  • Fees are charged for the space you use.

Common options

For information about the options common to all vmongodb subcommands, see Cloud DB for MongoDB (VPC) options.

Examples

If the request to create a Cloud DB for MongoDB instance is successful, the instance's configuration information and creation status are returned.

Command

The command example is as follows:

./ncloud vmongodb createCloudMongoDbInstance \
    --vpcNo 12345678 \
    --subnetNo 23456789 \
    --cloudMongoDbServiceName mongodb-01 \
    --cloudMongoDbServerNamePrefix mongodb \
    --clusterTypeCode SHARDED_CLUSTER \
    --cloudMongoDbUserName testuser \
    --cloudMongoDbUserPassword Examplepw123! \
    --cloudMongoDbImageProductCode SW.VMGDB.OS.LNX64.ROCKY.0810.MNGDB.CE.B050 \
    --memberProductCode SVR.VMGDB.MNGOD.HICPU.C002.M004.NET.SSD.B050.G002 \
    --arbiterProductCode SVR.VMGDB.ARBIT.HICPU.C002.M004.NET.SSD.B050.G002 \
    --mongosProductCode SVR.VMGDB.MNGOS.HICPU.C002.M004.NET.SSD.B050.G002 \
    --configProductCode SVR.VMGDB.CFGSV.HICPU.C002.M004.NET.SSD.B050.G002 \
    --shardCount 2 \
    --memberServerCount 2 \
    --arbiterServerCount 1 \
    --mongosServerCount 2 \
    --configServerCount 3 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "createCloudMongoDbInstanceResponse": {
    "totalRows": 1,
    "cloudMongoDbInstanceList": [
      {
        "cloudMongoDbInstanceNo": "34567890",
        "cloudMongoDbServiceName": "mongodb-01",
        "cloudMongoDbInstanceStatusName": "creating",
        "cloudMongoDbInstanceStatus": {
          "code": "INIT",
          "codeName": "CLOUD DATABASE (VPC) Init status"
        },
        "cloudMongoDbInstanceOperation": {
          "code": "CREAT",
          "codeName": "CLOUD DATABASE(VPC) Creat OP"
        },
        "generationCode": "G2",
        "clusterType": {
          "code": "SHARDED_CLUSTER",
          "codeName": "Sharding Cluster Type - Cloud DB for MongoDB (VPC)"
        },
        "engineVersion": "MongoDB 7.0.28 Community Edition",
        "licence": {
          "code": "OEM",
          "codeName": "License code - CLOUD DATABASE (VPC)"
        },
        "backupFileRetentionPeriod": 1,
        "backupTime": "02:00",
        "cloudMongoDbImageProductCode": "SW.VMGDB.OS.LNX64.ROCKY.0810.MNGDB.CE.B050",
        "accessControlGroupNoList": [],
        "shardCount": 2,
        "compress": {
          "code": "SNPP",
          "codeName": "Snappy"
        },
        "memberPort": 17017,
        "arbiterPort": 17017,
        "mongosPort": 17017,
        "configPort": 17017,
        "createDate": "2026-06-10T10:03:36+0900",
        "cloudMongoDbServerInstanceList": [
          {
            "cloudMongoDbServerName": "mg-mongodb-ab001-98eb",
            "clusterRole": {
              "code": "SHARD",
              "codeName": "Shard Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "AB",
              "codeName": "Arbiter"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.ARBIT.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "mongodb-01001",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-ab002-98ec",
            "clusterRole": {
              "code": "SHARD",
              "codeName": "Shard Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "AB",
              "codeName": "Arbiter"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.ARBIT.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "mongodb-01002",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-c-98ef",
            "clusterRole": {
              "code": "CONFIG_SERVER",
              "codeName": "Config Server Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "C",
              "codeName": "Config Server"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.CFGSV.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "csmongodb-01",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-c-98eg",
            "clusterRole": {
              "code": "CONFIG_SERVER",
              "codeName": "Config Server Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "C",
              "codeName": "Config Server"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.CFGSV.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "csmongodb-01",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-c-98eh",
            "clusterRole": {
              "code": "CONFIG_SERVER",
              "codeName": "Config Server Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "C",
              "codeName": "Config Server"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.CFGSV.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "csmongodb-01",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-mb001-98e7",
            "clusterRole": {
              "code": "SHARD",
              "codeName": "Shard Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "MB",
              "codeName": "Member"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.MNGOD.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "mongodb-01001",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-mb001-98e8",
            "clusterRole": {
              "code": "SHARD",
              "codeName": "Shard Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "MB",
              "codeName": "Member"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.MNGOD.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "mongodb-01001",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-mb002-98e9",
            "clusterRole": {
              "code": "SHARD",
              "codeName": "Shard Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "MB",
              "codeName": "Member"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.MNGOD.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "mongodb-01002",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-mb002-98ea",
            "clusterRole": {
              "code": "SHARD",
              "codeName": "Shard Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "MB",
              "codeName": "Member"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.MNGOD.HICPU.C002.M004.NET.SSD.B050.G002",
            "replicaSetName": "mongodb-01002",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-rt-98ed",
            "clusterRole": {
              "code": "MONGOS",
              "codeName": "Mongos Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "RT",
              "codeName": "Mongos"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.MNGOS.HICPU.C002.M004.NET.SSD.B050.G002",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          },
          {
            "cloudMongoDbServerName": "mg-mongodb-rt-98ee",
            "clusterRole": {
              "code": "MONGOS",
              "codeName": "Mongos Cluster Role - Cloud DB for MongoDB"
            },
            "cloudMongoDbServerInstanceStatusName": "creating",
            "cloudMongoDbServerInstanceStatus": {
              "code": "PEND",
              "codeName": "CLOUD DATABASE (VPC) server Pending status"
            },
            "cloudMongoDbServerInstanceOperation": {
              "code": "CREAT",
              "codeName": "CLOUD DATABASE (VPC) server Create OP"
            },
            "cloudMongoDbServerRole": {
              "code": "RT",
              "codeName": "Mongos"
            },
            "regionCode": "KR",
            "vpcNo": "12345678",
            "subnetNo": "23456789",
            "createDate": "2026-06-10T10:03:36+0900",
            "zoneCode": "KR-1",
            "memorySize": 4294967296,
            "cpuCount": 2,
            "dataStorageSize": 10737418240,
            "cloudMongoDbProductCode": "SVR.VMGDB.MNGOS.HICPU.C002.M004.NET.SSD.B050.G002",
            "dataStorageType": {
              "code": "SSD",
              "codeName": "SSD"
            }
          }
        ]
      }
    ],
    "requestId": "e5f6a7b8-c9d0-1234-ef01-234567890abc",
    "returnCode": "0",
    "returnMessage": "success"
  }
}