All Products
Search
Document Center

ApsaraDB for MongoDB:CreateShardingDBInstance

Last Updated:Sep 06, 2024

Creates or clones an ApsaraDB for MongoDB sharded cluster instance.

Operation description

  • Make sure that you fully understand the billing methods and pricing of ApsaraDB for MongoDB before you call this operation.
  • For more information about the instance types of ApsaraDB for MongoDB, see Instance types.
  • To create standalone instances and replica set instances, you can call the CreateDBInstance operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dds:CreateShardingDBInstancecreate
  • Instance
    acs:dds:{#regionId}:{#accountId}:dbinstance/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ZoneIdstringNo

The zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list.

cn-hangzhou-g
EnginestringYes

The database engine of the instance. Set the value to MongoDB.

MongoDB
EngineVersionstringYes

The database engine version of the instance. Valid values:

  • 7.0
  • 6.0
  • 5.0
  • 4.4
  • 4.2
  • 4.0
Note
  • For more information about the limits on database versions and storage engines, see MongoDB versions and storage engines.
  • If you call this operation to clone an instance, set the value of this parameter to the database engine version of the source instance.
  • Enumeration Value:
    • 3.0
    • 3.2
    • 3.4
    • 4.0
    • 4.2
    • 4.4
    • 5.0
    • 6.0
    • 7.0
    4.4
    DBInstanceDescriptionstringNo

    The name of the instance. The name of the instance must meet the following requirements:

    • The name must start with a letter.
    • It can contain digits, letters, underscores (_), and hyphens (-).
    • It must be 2 to 256 characters in length.
    test
    SecurityIPListstringNo

    The IP addresses in an IP address whitelist of the instance. Multiple IP addresses are separated by commas (,), and each IP address in the IP address whitelist must be unique. The following types of values are supported:

    • 0.0.0.0/0
    • IP addresses, such as 10.23.12.24.
    • CIDR blocks, such as 10.23.12.0/24. In this case, 24 indicates that the prefix of each IP address is 24-bit long. You can replace 24 with a value within the range of 1 to 32.
    Note
  • A maximum of 1,000 IP addresses and CIDR blocks can be configured for each instance.
  • If you enter 0.0.0.0/0, all IP addresses can access the instance. This may introduce security risks to the instance. Proceed with caution.
  • 192.168.xx.xx,192.168.xx.xx
    AccountPasswordstringNo

    The password of the root account. The password must meet the following requirements:

    • The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • The special characters include ! # $ % ^ & * ( ) _ + - =
    • The password of the account must be 8 to 32 characters in length.
    123456Aa
    ChargeTypestringNo

    The billing method of the instance. Valid values:

    • PostPaid (default): pay-as-you-go
    • PrePaid: subscription
    Note If this parameter is set to PrePaid, you must also configure the Period parameter.
    PrePaid
    PeriodintegerNo

    The subscription period of the instance. Unit: months.

    Valid values: 1 to 9, 12, 24, 36, and 60.

    Note When you set the ChargeType parameter to PrePaid, this parameter is valid and required.
    1
    NetworkTypestringNo

    The network type of the instance.

    Set the value to VPC.

    VPC
    VpcIdstringYes

    The ID of the VPC.

    vpc-bp1n3i15v90el48nx****
    VSwitchIdstringYes

    The vSwitch ID of the instance.

    vsw-bp1vj604nj5a9zz74****
    SrcDBInstanceIdstringNo

    The source instance ID.

    Note This parameter is required only if you call this operation to clone an instance. If you specify this parameter, you must also specify RestoreTime.
    dds-bp11483712c1****
    RestoreTimestringNo

    The point in time to restore the instance, which must be within seven days. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in Coordinated Universal Time (UTC).

    Note This parameter is required only if you call this operation to clone an instance. If you specify this parameter, you must also specify SrcDBInstanceId.
    2022-03-08T02:30:25Z
    ClientTokenstringNo

    The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

    ETnLKlblzczshOTUbOCz****
    StorageEnginestringNo

    The storage engine of the instance. Set the value to WiredTiger.

    Note
  • If you call this operation to clone an instance, set the value of this parameter to the storage engine of the source instance.
  • For more information about the limits on database versions and storage engines, see MongoDB versions and storage engines.
  • WiredTiger
    AutoRenewstringNo

    Specifies whether to enable auto-renewal for the instance. Valid values:

    • true
    • false (default)
    Note This parameter is available and optional if you set the value of ChargeType to PrePaid.
    true
    ProtocolTypestringNo

    The access protocol type of the instance. Valid values:

    • mongodb
    • dynamodb
    mongodb
    Mongosarray<object>Yes

    The mongos nodes of the instance.

    objectYes

    The information about the array object.

    ClassstringYes

    The instance type of the mongos node. For more information, see Sharded cluster instance types.

    Note
  • N specifies the serial number of the mongos node for which the instance type is specified. For example, Mongos.2.Class specifies the instance type of the second mongos node.
  • Valid values for N: 2 to 32.
  • mdb.shard.2x.xlarge.d
    ReplicaSetarray<object>Yes

    The information of the shard node.

    objectYes

    The information about the array object.

    ClassstringYes

    The instance type of the shard node. For more information, see Sharded cluster instance types.

    Note
  • N specifies the serial number of the shard node for which the instance type is specified. For example, ReplicaSet.2.Class specifies the instance type of the second shard node.
  • Valid values of N: 2 to 32.
  • dds.shard.standard
    StorageintegerYes

    The storage capacity of the shard node. Unit: GB.

    Note
  • The values that can be specified for this parameter vary based on the instance types. For more information, see Sharded cluster instance types.
  • N specifies the serial number of the shard node for which the storage space is specified. For example, ReplicaSet.2.Storage specifies the storage space of the second shard node.
  • 10
    ReadonlyReplicasintegerNo

    The number of read-only nodes in the shard node.

    Valid values: 0, 1, 2, 3, 4, and 5. Default value: 0.

    Note N specifies the serial number of the shard node for which you want to set the number of read-only nodes. ReplicaSet.2.ReadonlyReplicas specifies the number of read-only nodes in the second shard node.
    0
    ConfigServerarray<object>Yes

    The ConfigServer nodes of the instance.

    objectYes

    The information about the array object.

    ClassstringYes

    The instance type of the ConfigServer node. Valid values:

    • mdb.shard.2x.xlarge.d: 4 cores, 8 GB (dedicated). Only instances that run MongoDB 4.4 and later support this instance type.
    • dds.cs.mid :1 core, 2 GB (general-purpose). Only instances that run MongoDB 4.2 and earlier support this instance type.
    mdb.shard.2x.xlarge.d
    StorageintegerYes

    The storage space of the ConfigServer node. Unit: GB.

    Note The values that can be specified for this parameter vary based on the instance types. For more information, see Sharded cluster instance types.
    20
    SecondaryZoneIdstringNo

    The ID of secondary zone 1 for multi-zone deployment. Valid values:

    • cn-hangzhou-g: Hangzhou Zone G
    • cn-hangzhou-h: Hangzhou Zone H
    • cn-hangzhou-i: Hangzhou Zone I
    • cn-hongkong-b: Hong Kong Zone B
    • cn-hongkong-c: Hong Kong Zone C
    • cn-hongkong-d: Hong Kong Zone D
    • cn-wulanchabu-a: Ulanqab Zone A
    • cn-wulanchabu-b: Ulanqab Zone B
    • cn-wulanchabu-c: Ulanqab Zone C
    • ap-southeast-1a: Singapore Zone A
    • ap-southeast-1b: Singapore Zone B
    • ap-southeast-1c: Singapore Zone C
    • ap-southeast-5a: Jakarta Zone A
    • ap-southeast-5b: Jakarta Zone B
    • ap-southeast-5c: Jakarta Zone C
    • eu-central-1a: Frankfurt Zone A
    • eu-central-1b: Frankfurt Zone B
    • eu-central-1c: Frankfurt Zone C
    Note
  • This parameter is available and required if you set the value of EngineVersion to 4.4 or 5.0.
  • The value of this parameter cannot be the same as the value of ZoneId or HiddenZoneId.
  • For more information about the multi-zone deployment policy of a sharded cluster instance, see Create a multi-zone sharded cluster instance.
  • cn-hangzhou-h
    HiddenZoneIdstringNo

    The ID of secondary zone 2 for multi-zone deployment. Valid values:

    • cn-hangzhou-g: Hangzhou Zone G
    • cn-hangzhou-h: Hangzhou Zone H
    • cn-hangzhou-i: Hangzhou Zone I
    • cn-hongkong-b: Hong Kong Zone B
    • cn-hongkong-c: Hong Kong Zone C
    • cn-hongkong-d: Hong Kong Zone D
    • cn-wulanchabu-a: Ulanqab Zone A
    • cn-wulanchabu-b: Ulanqab Zone B
    • cn-wulanchabu-c: Ulanqab Zone C
    • ap-southeast-1a: Singapore Zone A
    • ap-southeast-1b: Singapore Zone B
    • ap-southeast-1c: Singapore Zone C
    • ap-southeast-5a: Jakarta Zone A
    • ap-southeast-5b: Jakarta Zone B
    • ap-southeast-5c: Jakarta Zone C
    • eu-central-1a: Frankfurt Zone A
    • eu-central-1b: Frankfurt Zone B
    • eu-central-1c: Frankfurt Zone C
    Note
  • This parameter is available and required if you set the value of EngineVersion to 4.4 or 5.0.
  • The value of this parameter cannot be the same as the value of ZoneId or SecondaryZoneId.
  • For more information about the multi-zone deployment policy of a sharded cluster instance, see Create a multi-zone sharded cluster instance.
  • cn-hangzhou-i
    StorageTypestringNo

    The storage type of the instance. Valid values:

    • cloud_essd1: ESSD PL1
    • cloud_essd2: ESSD PL2
    • cloud_essd3: ESSD PL3
    • local_ssd: local SSD
    Note
  • Instances of MongoDB 4.4 and later support only cloud disks. cloud_essd1 is selected if you leave this parameter empty.
  • Instances of MongoDB 4.2 and earlier support only local disks. local_ssd is selected if you leave this parameter empty.
  • cloud_essd1
    GlobalSecurityGroupIdsstringNo

    The global IP address whitelist template of the instance. Separate multiple templates with commas (,). The template name must be globally unique.

    g-qxieqf40xjst1ngp****
    Tagarray<object>No

    The custom tags that you want to add to the instance.

    objectNo

    The custom tags added to the instance.

    KeystringNo

    The tag key.

    Note N specifies the serial number of the tag. For example, Tag.1.Key specifies the key of the first tag and Tag.2.Key specifies the key of the second tag.
    testdatabase
    ValuestringNo

    The tag value.

    Note N specifies the serial number of the tag. For example, Tag.1.Value specifies the value of the first tag and Tag.2.Value specifies the value of the second tag.
    apitest
    EncryptedbooleanNo

    Indicates whether disk encryption is enabled.

    true
    EncryptionKeystringNo

    The ID of the custom key.

    2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    ProvisionedIopslongNo

    The provisioned IOPS of the instance:

    1960

    Response parameters

    ParameterTypeDescriptionExample
    object

    The returned information.

    RequestIdstring

    The request ID.

    D8F1D721-6439-4257-A89C-F1E8E9C9****
    DBInstanceIdstring

    The instance ID.

    dds-bp114f14849d****
    OrderIdstring

    The order ID.

    21010996721****

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "D8F1D721-6439-4257-A89C-F1E8E9C9****",
      "DBInstanceId": "dds-bp114f14849d****",
      "OrderId": "21010996721****"
    }

    Error codes

    HTTP status codeError codeError message
    400SecurityRisk.AuthVerificationwe have detected a risk with your default payment method. An email and notification has been sent to you. Please re-submit your order before after verificaiton.
    400InvaliadParameter.ShardsCount.LessThanSrcThe specified number of shards is less than that of source instance.
    400ORDER.ACCOUNT_INFORMATION_INCOMPLETEYour information is incomplete. Complete your information before ordering.
    400InvalidRegion.FormatSpecified Region is not valid.
    400Zone.ClosedThe specified zone is closed.
    400TokenServiceErrorThe request token is duplicated.
    400InvalidParamParam not valid.
    400InvalidEngineVersion.MalformedSpecified engine version is not valid.
    400InvalidParameters.FormatSpecified parameters is not valid.
    403InvalidBackupLogStatusCurrent backup log enable status does not support this operation.
    500VpcServiceErrorInvoke vpc service error.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2024-03-13The Error code has changedView Change Details
    2024-03-13The Error code has changedView Change Details
    2023-08-24The Error code has changed. The request parameters of the API has changedView Change Details
    2023-08-01The Error code has changed. The request parameters of the API has changedView Change Details
    2023-06-05The Error code has changed. The request parameters of the API has changedView Change Details
    2022-10-13The Error code has changed. The request parameters of the API has changedView Change Details
    2021-12-27The Error code has changedView Change Details
    2021-12-27The Error code has changed. The request parameters of the API has changedView Change Details