All Products
Search
Document Center

ApsaraDB for MongoDB:CreateDBInstance

Last Updated:Mar 02, 2023

Creates or clones an ApsaraDB for MongoDB replica set instance.

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 instances, see Instance types.

To create sharded cluster instances, you can call the CreateShardingDBInstance operation.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • 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 keyword: refers to the condition keyword defined by the cloud product itself.
  • 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.
OperateAccess levelResource typeCondition keywordAssociation operation
dds:CreateDBInstanceWRITE
  • MongoDB
    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.

NoteIf you call this operation to clone an instance or restore an instance from the recycle bin, set the value to the engine of the source instance.
cn-hangzhou
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 generated token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

ETnLKlblzczshOTUbOCz****
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.

  • 6.0
  • 5.0
  • 4.4
  • 4.2
  • 4.0
NoteIf you call this operation to clone an instance or restore an instance from the recycle bin, set the value to the engine of the source instance.
4.4
DBInstanceClassstringYes

The instance type. You can also call the DescribeAvailableResource operation to view instance types.

dds.mongo.standard
DBInstanceStorageintegerYes

The storage capacity of the instance. Unit: GB.

The values that can be specified for this parameter are subject to the instance types. For more information, see Replica set instance types.

10
DBInstanceDescriptionstringNo

The name of the instance. Valid values:

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

The IP addresses in an IP address whitelist. Separate multiple IP addresses with commas (,). Each IP address in the IP address whitelist must be unique. The following types of IP addresses are supported:

  • 0.0.0.0/0
  • IP addresses, such as 10.23.12.24.
  • Classless Inter-Domain Routing (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.

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.
  • These special characters include ! # $ % ^ & * ( ) _ + - =
  • The password is 8 to 32 characters in length.
123456Aa
ChargeTypestringNo

The billing method of the instance. Valid values:

  • PostPaid: pay-as-you-go
  • PrePaid: subscription
NoteIf you specify this parameter to PrePaid, you must also specify the Period parameter.
PrePaid
PeriodintegerNo

The subscription period of the instance. Unit: months.

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

NoteIf you specify the ChargeType parameter to PrePaid, this parameter is valid and required.
1
NetworkTypestringNo

The network type of the instance. Valid values:

VPC

VPC
VpcIdstringYes

The VPC ID of the instance.

vpc-bp175iuvg8nxqraf2****
VSwitchIdstringYes

The vSwitch ID of the instance.

vsw-bp1gzt31twhlo0sa5****
SrcDBInstanceIdstringNo

The ID of the source instance.

NoteThis parameter can only be specified when this operation is called to clone instances. You must also specify the BackupId parameter or RestoreTime parameter. If you call this operation to restore an instance from the recycle bin, only this parameter is required. The BackupId and RestoreTime parameters are not required.
dds-bp1ee12ad351****
BackupIdstringNo

The ID of the backup set. You can call the DescribeBackups operation to query the backup set ID.

NoteThis parameter is required only when you call this operation to clone an instance. If you specify this parameter, you must also specify the SrcDBInstanceId parameter.
32994****
RestoreTimestringNo

The point in time to clone the instance, which must be within seven days. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

NoteThis parameter is required only when you call this operation to clone an instance. If you specify this parameter, you must also specify the SrcDBInstanceId parameter.
2022-03-13T12:11:14Z
BusinessInfostringNo

The business information. This is an additional parameter.

{“ActivityId":"000000000"}
AutoRenewstringNo

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

  • true
  • false
NoteIf you set the ChargeType parameter to PrePaid, this parameter is valid and optional.
true
DatabaseNamesstringNo

The name of the database.

NoteWhen you call this operation to clone an instance, you can set the databases that are specified by this parameter for cloning. Otherwise, all databases of the instance are cloned.
mongodbtest
CouponNostringNo

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

youhuiquan_promotion_option_id_for_blank
StorageEnginestringNo

The storage engine used by the instance. Set the value to WiredTiger.

Note
  • If you call this operation to clone an instance or restore an instance from the recycle bin, set the value to the engine of the source instance.

  • For more information about the limits on database versions and storage engines, see MongoDB versions and storage engines.

WiredTiger
ReplicationFactorstringNo

The number of nodes in the replica set instance. Default value: 3. Valid values:

  • 3
  • 5
  • 7
3
ReadonlyReplicasstringNo

The number of read-only nodes in the replica set instance. Default value: 0. Valid values: 0 to 5.

0
ResourceGroupIdstringNo

The ID of the resource group to which the instances you want to query belong.

rg-acfmyiu4ekp****
ClusterIdstringNo

The ID of the dedicated cluster to which the instance belongs.

dhg-2x78****
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
cloud_essd1
SecondaryZoneIdstringNo

The zone where the secondary node is deployed 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: Hongkong Zone B.
  • cn-hongkong-c: Hongkong Zone C
  • cn-hongkong-d: Hongkong 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 valid and required when the EngineVersion parameter is set to 4.4 or 5.0.

  • The value of this parameter cannot be the same as the value of the ZoneId or HiddenZoneId parameter.

cn-hangzhou-h
HiddenZoneIdstringNo

The zone where the hidden node is deployed 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: Hongkong Zone B.
  • cn-hongkong-c: Hongkong Zone C
  • cn-hongkong-d: Hongkong 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 valid and required when the EngineVersion parameter is set to 4.4 or 5.0.

  • The value of this parameter cannot be the same as the value of the ZoneId or SecondaryZoneId parameter.

cn-hangzhou-i

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

The ID of the instance

dds-bp144a7f2db8****
OrderIdstring

The ID of the order.

21077576248****

Example

Normal return example

JSONFormat

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

Error codes

HTTP status codeError codeError messageDescription
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.-
400MissingParameterPeriod is mandatory for this action.-
400ORDER.ACCOUNT_INFORMATION_INCOMPLETEYour information is incomplete. Complete your information before ordering.-
400InvalidClientToken.MalformedSpecified parameter ClientToken is not valid.-
400InvalidDBInstanceDescription.MalformedSpecified parameter DBInstanceDescription is not valid.Invalid node name.
400InvalidSecurityIPListLength.MalformedThe quota of security ip exceeds.-
400InsufficientBalanceYour account does not have enough balance.The payment failed. Please add another payment method. You can also top up or add funds to your account.
400QuotaExceed.AfterpayInstanceLiving afterpay instances quota exceeded.-
400InvalidCapacity.NotFoundThe Capacity provided does not exist in our records.The specified storage capacity is invalid. Specify a storage capacity within a valid range. Unit: MB.
400ResourceNotAvailableResource you requested is not available for finance user.-
400IdempotentParameterMismatchRequest uses a client token in a previous request but is not identical to that request.The specified ClientToken parameter is already in use. Specify a client token that has not been used. The ClientToken value is generated by the client and must be unique among different requests. The value can be up to 64 ASCII characters in length and cannot contain non-ASCII characters.
400InvalidSecurityIPList.MalformedThe specified parameter "SecurityIPList" is not valid.-
400InvalidSecurityIPList.DuplicateThe Security IP address is not in the available range or occupied.-
400InvalidSecurityIPListLength.MalformedThe quota of security ip exceeds.-
400InvalidDBInstanceStorage.ValueNotSupportedThe specified parameter DBInstanceStorage is not valid.-
400InvalidAccountPassword.MalformedSpecified parameter AccountPassword is not valid.-
400TokenServiceErrorDuplicate ClientToken request.-
400Zone.ClosedThe specified zone is closed.-
400PRICE.ORIGIN_PRICE_ERRORThe origin price error.-
400NO_AVAILABLE_PAYMENT_METHODNo payment method is specified for your account. We recommend that you add a payment method.-
400InvalidEcsImage.NotFoundSpecified ecs image does not exist.-
400SaleValidateNoSpecificCodeFailedSpecified Storage or Version or InstanceClass is invalid.-
400Trade_Not_Support_Async_PayTrade not support async pay.-
403RealNameAuthenticationErrorYour account has not passed the real-name authentication yet.Real-name verification has not been completed for the Alibaba Cloud account. Complete real-name verification and try again.
403RegionUnauthorizedThere is no authority to create instance in the specified region.-
403OperationDeniedThe resource is out of usage.-
403InvalidEngineVersionInRegion.NotAvailableThe EngineVersion in the Region is not available.-
403InvalidBackupLogStatusCurrent backup log enable status does not support this operation.-
403IncorrectBackupSetStateCurrent backup set state does not support operations.The latest backup set is not ready. Please try again later.
404InvalidBackup.NotFoundThe available backup does not exist in recovery time.-

For a list of error codes, visit the API error center.