You can call the CreateDBInstance operation to create an ApsaraDB for RDS instance.
Before you call this operation, make sure that you fully understand the billing methods and pricing of ApsaraDB for RDS. For more information, visit the ApsaraDB for RDS pricing page.
For more information about the instance types that are supported by ApsaraDB for RDS, 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 that you select. For more information, see Primary instance types. |
DBInstanceNetType | String | Yes | Internet |
The network connection type of 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. |
Engine | String | Yes | MySQL |
The database engine that the instance runs. Valid values:
|
EngineVersion | String | Yes | 5.6 |
The version of the database engine that the instance runs. 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 a whitelist for an ApsaraDB RDS for MySQL instance. If the IP address whitelist contains more than one entry, separate them with commas (,). Each IP address whitelist can contain up to 1,000 unique entries. The following two formats are supported:
|
SystemDBCharset | String | No | gbk |
The character set that is used by the RDS instance. This parameter has been phased out. |
DBInstanceDescription | String | No | testdatabase |
The name of the instance. The name must be 2 to 255 characters in length. It can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter. Note The name of the instance cannot start with http:// or https://.
|
ClientToken | String | No | ETnLKlblzczshOTUbOCzxxxxxxxxxx |
The client token that is used to ensure the idempotency 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 only contain ASCII characters and cannot exceed 64 characters in length. |
ZoneId | String | No | cn-hangzhou-b |
The region ID of the primary instance if you create a primary instance. Note
|
ZoneIdSlave1 | String | No | cn-hangzhou-c |
The region ID of the secondary instance if you create a secondary instance. If you set this parameter to the same value as the ZoneId parameter, the instance is deployed in a single zone. Otherwise, the instance is deployed in multiple zones. |
ZoneIdSlave2 | String | No | cn-hangzhou-d |
The region ID of the log instance if you create a log instance. If you set this parameter to the same value as the ZoneId parameter, the instance is deployed in a single zone. Otherwise, the instance is deployed in multiple zones. |
InstanceNetworkType | String | No | Classic |
The network type of the instance. Valid values:
The default network type is Classic. Note
|
ConnectionMode | String | No | Standard |
The connection mode of the instance. Valid values:
The system automatically assigns a connection mode. Note If you create an instance that runs SQL Server 2012, SQL Server 2016, or SQL Server
2017, you can set this parameter only to Standard.
|
VPCId | String | No | vpc-xxxxxxxxxxxx |
The ID of the VPC to which the instance belongs. Note This parameter must be specified if you create an instance that runs MariaDB.
|
VSwitchId | String | No | vsw-xxxxxxxxxxx |
The ID of the VSwitch associated with the specified VPC. If you specify more than one VSwitch ID, separate them with commas (,). Note This parameter must be specified if you create an instance that runs MariaDB.
|
PrivateIpAddress | String | No | 172.16.201.69 |
The private IP address of the instance. The private IP address must fall within the CIDR block that is supported by the specified VSwitch. The system automatically assigns an IP address based on the specified VPCId and VSwitchId parameters. |
UsedTime | String | No | 2 |
The subscription duration of the instance if you specify to use subscription billing. Valid values:
Note This parameter must be specified if you set the PayType parameter to Prepaid.
|
Period | String | No | Year |
The renewal period of the instance if you specify to use subscription billing. Valid values:
Note This parameter must be specified if you set the PayType parameter to Prepaid.
|
ResourceGroupId | String | No | rg-acfmyxxxxxxxxxx |
The ID of the resource group to which the instance belongs. |
DBInstanceStorageType | String | No | cloud_ssd |
The storage type of 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 to encrypt data on the standard and enhanced SSDs in the specified region. You can obtain the ID of the key in the Key Management Service (KMS) console. Alternatively, you can create a key. For more information, see Manage CMKs. Note If this parameter is specified, disk encryption is enabled and 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 to the service account of the instance. This ARN is used to connect to KMS. You can copy the ARN from the RAM console. Note For more information about how to grant the service account the permissions to connect
to KMS in the RAM console, see Authorize RDS to access KMS.
|
AutoRenew | String | No | true |
Specifies whether to enable auto-renewal. 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 an instance in a dedicated cluster. |
TargetDedicatedHostIdForMaster | String | No | i-bpxxxxxxx1 |
The ID of the host to which the instance belongs if you create a primary instance in a dedicated cluster. |
TargetDedicatedHostIdForSlave | String | No | i-bpxxxxxxx2 |
The ID of the host to which the instance belongs if you create a secondary instance in a dedicated cluster. |
TargetDedicatedHostIdForLog | String | No | i-bpxxxxxxx3 |
The ID of the host to which the instance belongs if you create a log instance in a dedicated cluster. Note This parameter is not supported.
|
DBParamGroupId | String | No | rpg-sys-xxxx |
The ID of the parameter template that is used by 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 on the instance. Valid values:
|
TargetMinorVersion | String | No | rds_20200229 |
The minor engine version of the instance if you create an instance that runs MySQL. Format: RDS edition_Minor engine version. Examples: rds_20200229, xcluster_20200229, and xcluster80_20200229.
Note For more information about the minor engine versions, see Release Notes of Minor AliSQL Versions.
|
StorageAutoScale | String | No | Disable |
Specifies to enable or disable the automatic storage capacity scaling function. Valid values:
|
StorageThreshold | Integer | No | 50 |
The threshold based on which to trigger automatic storage capacity scaling. Unit: %. Valid values:
Note This parameter must be specified if you set the StorageAutoScale parameter to Enable.
|
StorageUpperBound | Integer | No | 2000 |
The maximum storage capacity that is allowed by the automatic storage capacity scaling function. Unit: GB. Valid values: an integer greater than or equal to 0. Note This parameter must be specified if you set the StorageAutoScale parameter to Enable.
|
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 specifies whether the endpoint is internal or public.
|
Port | String | 3306 |
The port that is used to connect to the instance. Note The DBInstanceNetType parameter specifies whether the port 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
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidZoneId.NotSupported | The Specified vpc Zone not supported. | The error message returned because the specified zone does not support the VPC network type. 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 have 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 have 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 concurrent operations in parallel. |
For a list of error codes, visit the API Error Center.