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 prices of ApsaraDB RDS. For more information, visit the ApsaraDB RDS product homepage.
For more information about ApsaraDB RDS instance types, see Primary 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. |
DBInstanceClass | String | Yes | rds.mysql.s1.small |
The instance type of the instance. For more information, see Primary instance types. You can call the DescribeAvailableResource operation to query the instance types that are available to a region. |
DBInstanceNetType | String | Yes | Internet |
The type of network connection to the instance. Valid values:
|
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 instance types. You can call the DescribeAvailableResource operation to query the storage capacity range that is supported for an instance type in a region. |
Engine | String | Yes | MySQL |
The database engine that is run on the instance. Valid values:
|
EngineVersion | String | Yes | 5.6 |
The database engine version that is run on the instance. Valid values:
|
PayType | String | Yes | Postpaid |
The billing method of the instance. Valid values:
|
RegionId | String | Yes | cn-hangzhou |
The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
SecurityIPList | String | Yes | 10.23.12.27/24 |
The IP address whitelist of the instance. For more information, see Configure an IP address whitelist for an ApsaraDB RDS for MySQL instance. If the IP address whitelist contains more than one entry, separate these entries with commas (,). The IP address whitelist can contain up to 1,000 unique entries. The IP address whitelist supports the following two formats:
|
SystemDBCharset | String | No | gbk |
The character set that is used for the instance. This parameter has been deprecated. |
DBInstanceDescription | String | No | testdatabase |
The name of the instance. The name must be 2 to 255 characters in length. The name can contain letters, digits, underscores (_), and hyphens (-). Note The name cannot start with http:// or https://.
|
ClientToken | String | No | ETnLKlblzczshOTUbOCzxxxxxxxxxx |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
ZoneId | String | No | cn-hangzhou-b |
The zone ID of the primary instance. Note
|
ZoneIdSlave1 | String | No | cn-hangzhou-c |
The zone ID of the secondary instance. If you set the ZoneIdSlave1 parameter to the same value as the ZoneId parameter, the single-zone deployment method is used. If you set the ZoneIdSlave1 parameter to a different value than the ZoneId parameter, the multi-zone deployment method is used. |
ZoneIdSlave2 | String | No | cn-hangzhou-d |
The zone ID of the logger instance. If you set the ZoneIdSlave2 parameter to the same value as the ZoneId parameter, the single-zone deployment method is used. If you set the ZoneIdSlave2 parameter to a different value than the ZoneId parameter, 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 mode that is used to connect to the instance. Valid values:
By default, the system 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-xxxxxxxxxxxx |
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-xxxxxxxxxxx |
The ID of the vSwitch associated with the specified VPC. If you specify more than one vSwitch ID, separate these vSwitch IDs with commas (,). Note If you set the InstanceNetworkType parameter to VPC, you must specify the VSwitchId parameter.
|
PrivateIpAddress | String | No | 172.16.201.69 |
The private IP address of the instance. The private IP address must be within the CIDR block that is supported by the specified vSwitch. By default, the system assigns a private IP address to the instance based on 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 |
The renewal cycle of the instance. Valid values:
Note If you set the PayType parameter to Prepaid, you must specify the Period parameter.
|
ResourceGroupId | String | No | rg-acfmyxxxxxxxxxx |
The ID of the resource group to which the instance belongs. |
DBInstanceStorageType | String | No | cloud_ssd |
The type of storage media that is used for the instance. Valid values:
|
BusinessInfo | String | No | 121436975448952 |
The extended business information of the instance. |
EncryptionKey | String | No | 0d24xxxx-da7b-4786-b981-9a164dxxxxxx |
The ID of the key that is used for disk encryption in the region of the instance. 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 Manage CMKs. Note If you specify the EncryptionKey parameter, disk encryption is 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 to the service account of the instance by your Alibaba Cloud account. The ARN is used to connect to KMS. You can copy the ARN from the RAM console. Note For more information about how to grant permissions by using 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 need to specify this parameter only when the instance uses the subscription billing method. Valid values: true and false. Note
|
Category | String | No | HighAvailability |
The RDS edition of the instance. Valid values:
|
DedicatedHostGroupId | String | No | dhg-4nxxxxxxx |
The ID of the dedicated cluster to which the instance belongs. If you create the instance in a dedicated cluster, you must specify the DedicatedHostGroupId parameter. |
TargetDedicatedHostIdForMaster | String | No | i-bpxxxxxxx1 |
The ID of the host to which the primary instance belongs. If you create the instance in a dedicated cluster, you must specify this parameter. If you do not specify this parameter, the system assigns a host to the instance. |
TargetDedicatedHostIdForSlave | String | No | i-bpxxxxxxx2 |
The ID of the host to which the secondary instance belongs. If you create the instance in a dedicated cluster and select the High-availability or Enterprise Edition, you must specify this parameter. If you do not specify this parameter, the system assigns a host to the instance. |
TargetDedicatedHostIdForLog | String | No | i-bpxxxxxxx3 |
The ID of the host to which the logger instance belongs. If you create the instance in a dedicated cluster and select the Enterprise Edition, you must specify this parameter. If you do not specify this parameter, the system assigns a host to the instance. |
DBParamGroupId | String | No | rpg-sys-xxxx |
The ID of the parameter template that is used for the instance. |
DBTimeZone | String | No | +08:00 |
The UTC time zone of the instance. Valid values: -12:59 to +13:00. Note
|
DBIsIgnoreCase | String | No | 1 |
Specifies whether table names are case-sensitive. Valid values:
|
TargetMinorVersion | String | No | rds_20200229 |
The minor engine version that is run on the instance. You need to specify this parameter only when you select the MySQL database engine. Format: RDS edition_Minor engine version. Examples: rds_20200229, xcluster_20200229, and xcluster80_20200229. The following codes are used to represent RDS editions:
Note For more information about the minor engine versions, see Release notes of minor AliSQL versions.
|
StorageAutoScale | String | No | Disable |
Specifies whether to enable the automatic storage capacity expansion feature. Valid values:
Default value: Disable. |
StorageThreshold | Integer | No | 50 |
The threshold based on which automatic storage capacity expansion is triggered. Unit: %. 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 capacity expansion. The specified storage capacity cannot exceed the maximum value. 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.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DBInstanceId | String | rm-uf6wjk5xxxxxxxxxx |
The ID of the instance. |
OrderId | String | 1007893702xxxxx |
The ID of the order. |
ConnectionString | String | rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com |
The endpoint that is used to connect to the instance. Note The DBInstanceNetType parameter indicates whether the endpoint is internal or public.
|
Port | String | 3306 |
The port number that is used to connect to the instance. Note The DBInstanceNetType parameter indicates whether the port number is internal or public.
|
RequestId | String | 1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC |
The ID of the request. |
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.12.27/24
&<Common request parameters>
Sample success responses
XML
format
<CreateDBInstanceResponse>
<OrderId>1007893702xxxxx</OrderId>
<ConnectionString>rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com</ConnectionString>
<DBInstanceId>rm-uf6wjk5xxxxxxx</DBInstanceId>
<Port>3306</Port>
<RequestId>1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC</RequestId>
</CreateDBInstanceResponse>
JSON
format
{
"OrderId": "1007893702xxxxx",
"ConnectionString": "rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com",
"DBInstanceId": "rm-uf6wjk5xxxxxxx",
"Port": "3306",
"RequestId": "1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidZoneId.NotSupported | The Specified vpc Zone not supported. | The error message returned because the specified zone does not allow you to create the instance in a VPC. Change the zone and try again. |
400 | InvalidPaymentMethod.Incomplete | No payment method is specified for your account. We recommend that you add a payment method. | The error message returned because your Alibaba Cloud account does not provide a valid payment method. 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 your Alibaba Cloud account does not provide a valid payment method. Add a valid payment method and try again. |
400 | SYSTEM.CONCURRENT_OPERATE | Concurrent operation is detected. | The error message returned because the system runs threads in parallel. |
400 | ZoneId.NotMatchWithCategory | The number of ZoneId specified does not match with category. | The error message returned because the number of zone IDs specified in the ZoneId parameter is not supported for the specified deployment method. |
For a list of error codes, visit the API Error Center.