You can call the CreateDBInstance operation to create an ApsaraDB RDS instance.
Before you call this operation, make sure that you understand the billing methods and pricing of ApsaraDB RDS. For more information, see Billable items, billing methods, and pricing.
For more information about ApsaraDB RDS instance types, see Primary ApsaraDB RDS instance types.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDBInstance |
The operation that you want to perform. Set the value to CreateDBInstance. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
Engine | String | Yes | MySQL |
The database engine that is run by the instances. Valid values:
|
EngineVersion | String | Yes | 5.6 |
The database engine version that is run on the instances. Valid values:
|
DBInstanceClass | String | Yes | rds.mysql.s1.small |
The instance type of the instance. For more information, see Primary ApsaraDB RDS instance types. You can also call the DescribeAvailableResource operation to query the available instance types in a region. |
DBInstanceStorage | Integer | Yes | 20 |
The storage capacity of the instance. Unit: GB. The storage capacity increases in increments of 5 GB. For more information, see Primary ApsaraDB RDS instance types. You can also call the DescribeAvailableResource operation to query the storage capacity range that is supported for a specified instance type in a region. |
SystemDBCharset | String | No | gbk |
The character set that is used by the instance. This parameter is no longer used. |
DBInstanceNetType | String | Yes | Internet |
The type of network connection to the instance. Valid values:
|
DBInstanceDescription | String | No | testdatabase |
The name of the instance. The name must be 2 to 255 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter. Note The name cannot start with http:// or https://.
|
SecurityIPList | String | Yes | 10.10.XX.XX/24 |
The IP address whitelist of the instance. For more information, see Use a database client or the CLI to connect to an ApsaraDB RDS for MySQL instance. If the IP address whitelist contains more than one entry, separate the entries with commas (,). Each entry must be unique. The IP address whitelist can contain up to 1,000 entries. The entries in the IP address whitelist must be in one of the following formats:
|
ClientToken | String | No | ETnLKlblzczshOTUbOCz***** |
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. |
PayType | String | Yes | Postpaid |
The billing method of the instance. Valid values:
Note The system automatically generates a purchase order and completes the payment.
|
ZoneId | String | No | cn-hangzhou-b |
The ID of the zone in which the primary instance resides. Note
|
ZoneIdSlave1 | String | No | cn-hangzhou-c |
The ID of the zone in which the secondary instance resides. If you set the ZoneIdSlave1 parameter and the ZoneId parameter to the same value, the single-zone deployment method is used. If you set the ZoneIdSlave1 parameter and the ZoneId parameter to different values, the multi-zone deployment method is used. |
ZoneIdSlave2 | String | No | cn-hangzhou-d |
The ID of the zone in which the logger instance resides. If you set the ZoneIdSlave2 parameter and the ZoneId parameter to the same value, the single-zone deployment method is used. If you set the ZoneIdSlave2 parameter and the ZoneId parameter to different values, the multi-zone deployment method is used. |
InstanceNetworkType | String | No | Classic |
The network type of the instance. Valid values:
Note
|
ConnectionMode | String | No | Standard |
The connection mode of the instance. Valid values:
The system automatically assigns a connection mode to the instance. Note SQL Server 2012, SQL Server 2016, and SQL Server 2017 support only the standard mode.
|
VPCId | String | No | vpc-***** |
The ID of the VPC to which the instance belongs. Note If you set the InstanceNetworkType parameter to VPC, you must specify the VPCId parameter.
|
VSwitchId | String | No | vsw-***** |
The ID of the vSwitch that is associated with the specified VPC. The vSwitch must belong to the zone that is specified by the ZoneId parameter. Note If you set the InstanceNetworkType parameter to VPC, you must specify the VSwitchId parameter.
|
PrivateIpAddress | String | No | 172.16.XX.XX |
The private IP address of the instance. The private IP address must be within the CIDR block that is supported by the specified vSwitch. ApsaraDB RDS automatically assigns a private IP address to the instance based on the values of the VPCId and vSwitchId parameters. |
UsedTime | String | No | 2 |
The subscription period of the instance. Valid values:
Note If you set the PayType parameter to Prepaid, you must specify the UsedTime parameter.
|
Period | String | No | Year |
Specifies whether to use yearly subscription or monthly subscription for the instance. Valid values:
Note If you set the PayType parameter to Prepaid, you must specify the Period parameter.
|
ResourceGroupId | String | No | rg-acfmy***** |
The ID of the resource group to which the instance belongs. |
DBInstanceStorageType | String | No | cloud_essd |
The storage type that is used by the instance. Valid values:
Note The default value of this parameter is determined by the instance type specified by
the DBInstanceClass parameter.
|
BusinessInfo | String | No | 121436975448952 |
The additional business information about the instance. |
EncryptionKey | String | No | 0d24*****-da7b-4786-b981-9a164dxxxxxx |
The ID of the key that is used for disk encryption in the region where the instance resides. You can obtain the ID of the key from the Key Management Service (KMS) console. You can also create a key. For more information, see Create a CMK. Note If you specify the EncryptionKey parameter, disk encryption is automatically enabled.
In this case, you must also specify the RoleARN parameter. Disk encryption cannot be disabled after it is enabled.
|
RoleARN | String | No | acs:ram::1406xxxxxx:role/aliyunrdsinstanceencryptiondefaultrole |
The Alibaba Cloud Resource Name (ARN) that is provided by your Alibaba Cloud account for RAM users. RAM users can use the ARN to connect ApsaraDB RDS to KMS. You can copy the ARN from the RAM console. Note For more information about how to grant permissions to RAM users in the RAM console,
see Authorize an ApsaraDB RDS for MySQL instance to access KMS.
|
AutoRenew | String | No | true |
Specifies whether to enable auto-renewal for the instance. You must specify this parameter only when the instance uses the subscription billing method. Valid values:
|
Category | String | No | HighAvailability |
The RDS edition of the instance. Valid values:
|
DedicatedHostGroupId | String | No | dhg-4n***** |
The ID of the dedicated cluster to which the instance belongs. If you create the instance in a dedicated cluster, you must specify this parameter. Note
|
TargetDedicatedHostIdForMaster | String | No | i-bp*****1 |
The ID of the host to which the instance belongs in the specified dedicated cluster. If you create the instance in a dedicated cluster, you must specify this parameter. If you do not specify this parameter, the system automatically assigns a host. Note
|
TargetDedicatedHostIdForSlave | String | No | i-bp*****2 |
The ID of the host to which the secondary instance belongs in the specified dedicated cluster. If the instance runs RDS High-availability Edition or RDS Enterprise Edition and you create the instance in a dedicated cluster, you must specify this parameter. If you do not specify this parameter, the system automatically assigns a host. Note
|
TargetDedicatedHostIdForLog | String | No | i-bp*****3 |
The ID of the host to which the logger instance belongs in the specified dedicated cluster. If the instance runs RDS Enterprise Edition and you create the instance in a dedicated cluster, you must specify this parameter. If you do not specify this parameter, the system automatically assigns a host. Note
|
DBParamGroupId | String | No | rpg-sys-***** |
The ID of the parameter template. |
DBTimeZone | String | No | +08:00 |
The time zone of the instance. This parameter takes effect only when you set the Engine parameter to MySQL or PostgreSQL.
Note
|
DBIsIgnoreCase | String | No | true |
Specifies whether table names are case-sensitive. Valid values:
|
TargetMinorVersion | String | No | rds_20200229 |
The minor engine version that is run by the instance. You must specify this parameter only when the instance runs MySQL. Format: RDS edition_Minor engine version. Examples: rds_20200229, xcluster_20200229, and xcluster80_20200229. The following codes are used to represent RDS editions and database engine versions:
Note For more information about minor engine versions, see Release notes for AliSQL.
|
StorageAutoScale | String | No | Disable |
Specifies whether to enable automatic storage expansion for the instance. Valid values:
Note After the instance is created, you can call the ModifyDasInstanceConfig operation to modify the settings of the automatic storage expansion feature for the
instance. For more information, see Configure automatic storage expansion for an ApsaraDB RDS for MySQL instance.
|
StorageThreshold | Integer | No | 50 |
The threshold based on which automatic storage expansion is triggered. The threshold is a percentage. Valid values:
Note If you set the StorageAutoScale parameter to Enable, you must specify the StorageThreshold parameter.
|
StorageUpperBound | Integer | No | 2000 |
The maximum storage capacity that is allowed for automatic storage expansion. The storage capacity of the instance cannot exceed the maximum storage capacity. Unit: GB. Valid values: an integer greater than or equal to 0. Note If you set the StorageAutoScale parameter to Enable, you must specify the StorageUpperBound parameter.
|
DryRun | Boolean | No | false |
Specifies whether to conduct a precheck before the system creates the instance. Valid values:
|
UserBackupId | String | No | 67798***** |
The ID of the backup file that is used to create the instance. You can call the ListUserBackupFiles operation to query backup files. If you create the instance by using the data of a backup file, you must specify this parameter. Note This parameter is supported only when the following requirements are met:
|
Amount | Integer | No | 2 |
The number of ApsaraDB RDS for MySQL instances that you want to create. The parameter takes effect only when you create multiple ApsaraDB RDS for MySQL instances at a time by using a single request. Valid values: 1 to 20. Default value: 1. Note
|
CreateStrategy | String | No | Atomicity |
The policy based on which multiple instances are created. The parameter takes effect only when the value of the Amount parameter is greater than 1.
Default value: Atomicity. |
DeletionProtection | Boolean | No | true |
Specifies whether to enable the release protection feature for the instance.
|
BabelfishConfig | String | No | {"babelfishEnabled":"true","migrationMode":"single-db","masterUsername":"babelfish_user","masterUserPassword":"Babelfish123!"} |
The configuration of an ApsaraDB RDS for PostgreSQL instance for which Babelfish is enabled. Format:{"babelfishEnabled":"true","migrationMode":"xxxxxxx","masterUsername":"xxxxxxx","masterUserPassword":"xxxxxxxx"} The following list describes the fields in the format:
Note This parameter takes effect only when you create an ApsaraDB RDS for PostgreSQL instance.
For more information, see Introduction to Babelfish.
|
MaxCapacity | double | No | 8 |
The maximum value of Rds Capacity Unit (RCU). |
MinCapacity | double | No | 0.5 |
The minimum value of RCU. |
Tag.N.Key | String | No | testkey1 |
The key of the tag that you want to add to the instance. You can use this parameter to add tags to the instance. The value of the N variable in the Tag.N.Key parameter ranges from 1 to 20. You can specify this parameter multiple times to create and add multiple tags to the instance. For example, if you want to create and add two tags to the instance, you must specify the Tag.1.Key and Tag.2.Key parameters. Note
|
Tag.N.Value | String | No | testvalue1 |
The tag value that is associated with the specified tag key. You can use this parameter to add tags to the instance. The value of the N variable in the Tag.N.Value parameter ranges from 1 to 20. You can specify multiple values for this parameter to create and add multiple tags to the instance. This parameter must be used together with the Tag.N.Key parameter. For example, if you specify the Tag.1.Key and Tag.2.Key parameters, you must also specify the Tag.1.Value and Tag.2.Value parameters. Note
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DryRunResult | Boolean | true |
Indicates whether the request passed the precheck. Valid values:
|
TagResult | Boolean | true |
Indicates whether the specified tag is added to the instance. Valid values:
Note If you do not add a tag to the instance, this parameter is not returned.
|
RequestId | String | 1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC |
The ID of the request. |
ConnectionString | String | rm-uf6wjk5*****.mysql.rds.aliyuncs.com |
The endpoint that is used to connect to the instance. Note The DBInstanceNetType parameter specifies whether the endpoint is an internal endpoint or a public endpoint.
|
Message | String | Batch Create DBInstance Task Is In Process. |
The message that indicates whether multiple instances are created. The parameter is returned only when the value of the Amount parameter is greater than 1. |
DBInstanceId | String | rm-uf6wjk5***** |
The ID of the instance. If the value of the Amount parameter is greater than 1, more than one instance ID is returned. The number of instance IDs that are returned is the same as the value of the Amount parameter. The returned instance IDs are separated by commas (,). For example, if the value of the Amount parameter is 3, three instance IDs are returned. Example: rm-uf6wjk5*****1,rm-uf6wjk5*****2,rm-uf6wjk5*****3 |
Port | String | 3306 |
The port that is used to connect to the instance. Note The DBInstanceNetType parameter specifies whether the port is an internal port or a public port.
|
TaskId | String | s2365879-a9d0-55af-fgae-f2***** |
The ID of the task that is run to create multiple instances. The parameter is returned only when the value of the Amount parameter is greater than 1. Note The TaskID parameter cannot be used to query a task.
|
DryRun | Boolean | true |
Indicates that the system prechecks the request before the system creates the instance. The return value is fixed as true. Note If the system does not perform a precheck, this parameter is not returned.
|
OrderId | String | 1007893702***** |
The ID of the order. |

Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=CreateDBInstance
&RegionId=cn-hangzhou
&Engine=MySQL
&EngineVersion=5.6
&DBInstanceClass=rds.mysql.s1.small
&DBInstanceStorage=20
&DBInstanceNetType=Internet
&PayType=Postpaid
&SecurityIPList=10.23.XX.XX/24
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDBInstanceResponse>
<OrderId>1007893702*****</OrderId>
<ConnectionString>rm-uf6wjk5*****.mysql.rds.aliyuncs.com</ConnectionString>
<DBInstanceId>rm-uf6wjk5*****</DBInstanceId>
<Port>3306</Port>
<RequestId>1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC</RequestId>
</CreateDBInstanceResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"OrderId" : "1007893702*****",
"ConnectionString" : "rm-uf6wjk5*****.mysql.rds.aliyuncs.com",
"DBInstanceId" : "rm-uf6wjk5*****",
"Port" : 3306,
"RequestId" : "1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidInstanceLevel.DiskType | Specified instance level not support request disk type | The error message returned because the specified instance type does not support the specified storage type. |
400 | RR309 | We have detected a security risk with your payment method. Please proceed with verification via the link in your email or console message and re-submit your order after verification. | The error message returned because security risks are detected in your payment method. Click the link in the email that is sent to you or in the ApsaraDB RDS console to continue with the verification. After you complete the verification, submit the order again. |
400 | InvalidZoneId.NotSupported | The Specified vpc Zone not supported. | The error message returned because the specified zone does not allow you to create an instance in a VPC. Specify a different zone and try again. |
400 | InvalidZone.NotSupported | The Specified Zone not supported. | The error message returned because the specified region ID is invalid. |
400 | InvalidEssdStorageSize | invalid cloud essd storage size. | The error message returned because the specified instance type is invalid. Select a valid instance type and try again. |
400 | IncompleteAccountInfo | Your information is incomplete. Complete your information before the operation. | The error message returned because your account information is incomplete. Log on to the Account Center console and specify all account information items that are labeled with an asterisk (*). Check the information items in the Basic Information page. |
400 | IncompleteTaxInfo | Your tax information is incomplete. Complete your information before the operation. | The error message returned because your tax information is incomplete. Specify all required tax information. |
400 | InvalidPaymentMethod.Incomplete | No payment method is specified for your account. We recommend that you add a payment method. | The error message returned because no valid payment method is provided within your Alibaba Cloud account. Add a valid payment method and try again. |
400 | InvalidPaymentMethod.Missing | No payment method is specified for your account. We recommend that you add a payment method. | The error message returned because no valid payment method is provided within your Alibaba Cloud account. Add a valid payment method and try again. |
400 | InsuffcientBalanceOrBankAccount | Add a payment method or add funds to the prepayment balance. Get started by creating an instance. | The error message returned because no valid payment method is provided within the current Alibaba Cloud account. Add a valid payment method or add funds to the current Alibaba Cloud account. |
400 | VswitchIpExhausted | Vswitch IP exhausted. | The error message returned because vSwitch IP addresses are depleted. |
400 | InvalidPrivateIpAddress.AlreadyUsed | The specified IP is already used. | The error message returned because the specified IP address is in use. |
400 | InvalidMinorVersion.NotFound | Sepcified minor version does not exists. | The error message returned because the specified minor engine version does not exist. |
400 | SYSTEM.CONCURRENT_OPERATE | Concurrent operation is detected. | The error message returned because concurrent operations are running in the system. |
400 | ZoneId.NotMatchWithCategory | The number of ZoneId specified does not match with category. | The error message returned because the number of zones that you specify is not supported for the specified database engine or RDS edition. Specify a valid number of zones and try again. |
400 | InvalidSecurityIPList.Format | The specified parameter securityIPList is not valid. | The error message returned because the specified IP address whitelist is in an invalid format. Modify the IP address whitelist and try again. |
400 | InvalidEngineVersion.Malformed | The specified parameter EngineVersion is not valid. | The error message returned because the specified database engine version is invalid. Check the database engine version and try again. |
400 | CreditPayInsufficientBalance | Insufficient credit pay limit. Please contact your channel partner to increase the limit. | The error message returned because your Alibaba Cloud account does not have a sufficient balance. Make sure that the balance of your Alibaba Cloud account is sufficient. |
400 | InvalidTagKey.Malformed | The Tag.N.Key parameter is empty. | The error message returned because the Tag.N.Key parameter is empty. |
400 | InvalidTagValue.Malformed | The Tag.N.Value parameter is empty. | The error message returned because the Tag.N.Value parameter is empty. |
400 | Duplicate.TagKey | The Tag.N.Key contains duplicate keys. | The error message returned because the Tag.N.Key parameter specifies a duplicate key. |
400 | NumberExceed.Tags | The maximum number of Tags is exceeded. The maximum is 20. | The error message returned because the number of tags that you specify exceeds the maximum number of tags that are allowed. A maximum of 20 tags are allowed. |
400 | MissingParameter.ResourceIds | The parameter ResourceIds.N must not be null. | The error message returned because the ResourceIds.N parameter is empty. |
400 | InvalidParameter.TagKey | The Tag.N.Key parameter is invalid. | The error message returned because the value of the Tag.N.Key parameter is invalid. |
400 | InvalidParameter.TagValue | The Tag.N.Value parameter is invalid. | The error message returned because the value of the Tag.N.Value parameter is invalid. |
400 | NoPermission.SystemTag | You have no permission to use system tags. | The error message returned because the tags that you specify are system tags. |
400 | InvalidParam.Amount | Amount is allowed from 1 to 20. | The error message returned because the value of the Amount parameter is not within the range of 1 to 20. |
400 | InvalidParam.CreateStrategy | Only Atomicity and Partial are allowed. | The error message returned because the value of the CreateStrategy parameter is not Atomicity or Partial. |
401 | CannotDecreaseEssdPerfLevel | cannot decrease cloud essd performance level. | The error message returned because the storage type change failed the verification. An instance that runs SQL Server with standard SSDs or ESSDs can be upgraded only to use standard SSDs or ESSDs with the new specifications. |
For a list of error codes, visit the API Error Center.