You can call the CreateDBInstance operation to create an 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 of the instance. Valid values:
Note To create a serverless instance, you must set this parameter to MySQL. |
EngineVersion | String | Yes | 5.6 | The database engine version of the instance.
Note To create a serverless instance, you must set this parameter to 8.0. |
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. Note To create a serverless instance, you must set this parameter to mysql.n2.serverless.1c. |
DBInstanceStorage | Integer | Yes | 100 | The storage capacity of the instance. Unit: GB. You can increase the storage capacity at a step size 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 deprecated. |
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 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. |
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 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 from 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 from 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 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. Note If you set the InstanceNetworkType parameter to VPC, you must also specify this parameter. |
VSwitchId | String | No | vsw-***** | The ID of the vSwitch. The vSwitch must belong to the zone that is specified by the ZoneId parameter. Note
|
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 duration of the instance. Valid values:
Note If you set the PayType parameter to Prepaid, you must also specify this parameter. |
Period | String | No | Year | The unit of the subscription duration. Valid values:
Note If you set the PayType parameter to Prepaid, you must also specify this parameter. |
ResourceGroupId | String | No | rg-acfmy***** | The ID of the resource group to which the instance belongs. |
DBInstanceStorageType | String | Yes | cloud_essd | The storage type of 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 in which the instance resides. 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. 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. |
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 call the CheckCloudResourceAuthorized operation to query the ARN. |
AutoRenew | String | No | true | Specifies whether to enable the auto-renewal feature for the instance. You must specify this parameter only when the instance uses the subscription billing method. valid values:
Note
|
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 in the dedicated cluster belongs. 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 in the dedicated cluster belongs. 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 in the dedicated cluster belongs. 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. You can call the DescribeParameterGroups operation to query ID of the parameter template. Note
|
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 the table name is case-sensitive. Valid values:
|
TargetMinorVersion | String | No | rds_20200229 | The minor engine version of the instance. This parameter is required only when you create an instance that runs MySQL or PostgreSQL. The value format varies based on the database engine of the instance.
Note You can call the DescribeDBMiniEngineVersions operation to query the minor engine version. For more information about minor engine versions, see Release notes for AliSQL.
Note If you configure the BabelfishConfig parameter for your ApsaraDB RDS for PostgreSQL instance and set the babelfishEnabled field to true, the value of this parameter is in the following format: rds_postgres_Major engine version00_AliPG version_babelfish . |
StorageAutoScale | String | No | Disable | Specifies whether to enable the automatic storage expansion feature 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 in percentage based on which automatic storage expansion is triggered.
Note If you set the StorageAutoScale parameter to Enable, you must also specify this 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.
|
DryRun | Boolean | No | false | Specifies whether to perform a dry run. Valid values:
|
UserBackupId | String | No | 67798***** | The ID of the backup file. You can call the ListUserBackupFiles operation to query backup files. If you want to create an 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. Valid values:
Note Default value: Atomicity. |
Tag.N.Key | String | No | testkey1 | The key of tag N that you want to add to the instance. You can use this parameter to add tags to the instance. Note
|
Tag.N.Value | String | No | testvalue1 | The value of tag N that is added to the instance. You can use this parameter to add tags to the instance. Note
|
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 the Babelfish feature for the ApsaraDB RDS for PostgreSQL instance. 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. |
ServerlessConfig | Object | No | The settings of the serverless instance. This parameter is required when you create a serverless instance. Note This parameter takes effect only when you create an ApsaraDB RDS for MySQL instance. |
|
MaxCapacity | double | No | 8 | The maximum number of RDS Capacity Units (RCUs). Valid values: 0.5 to 8. Note The value of this parameter must be greater than or equal to the value of the MinCapacity parameter. |
MinCapacity | double | No | 0.5 | The minimum number of RCUs. Valid values: 0.5 to 8. Note The value of this parameter must be less than or equal to the value of the MaxCapacity parameter. |
AutoPause | Boolean | No | true | Specifies whether to enable the smart startup and stop feature for the serverless instance. Valid values:
Note After the smart startup and stop feature is enabled, if no connections to the instance are established within 10 minutes, the instance is stopped. After a connection is established to the instance, the instance is automatically woken up. |
SwitchForce | Boolean | No | false | Specifies whether to enable the forced scaling feature for the serverless instance. Valid values:
Note
|
ConnectionString | String | No | rm-uf6wjk5*****.mysql.rds.aliyuncs.com | The endpoint of the instance. Note The DBInstanceNetType parameter specifies whether the endpoint is an internal endpoint or a public endpoint. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DryRunResult | Boolean | true | Indicates whether the request passed the dry run. 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 of 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. Note This parameter is returned only when the value of the Amount parameter is greater than 1. |
DBInstanceId | String | rm-uf6wjk5***** | The ID of 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. Examples: rm-uf6wjk5*****1,rm-uf6wjk5*****2,rm-uf6wjk5*****3
|
Port | String | 3306 | The port of 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. Note
|
DryRun | Boolean | true | Indicates that the system performed a dry run. Note
|
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=100
&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.NotSupportedForStorageType | The specified zone is closed or invalid for Specified DBInstanceStorageType. | The error message returned because the specified zone is no longer available or the specified DBInstanceStorageType parameter is invalid. |
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 | InvalidConcurrentOperate | Concurrent operation is detected. | The error message returned because concurrent operations are running in the system. Wait until the previous operation is complete and try again. |
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 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. |
400 | InvalidConnectionString.Duplicate | Specified connection string already exists in the Aliyun RDS. | The error message returned because the endpoint that you specified already exists. Specify a different endpoint. |
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. |
403 | AliCroup2CloudUserCannotBuyNotInnerCommodity | There is no group cloud commodity label, and users within the group are not allowed to purchase. | The error message returned because the commodities are not labeled with Alibaba Cloud and are not available for internal users. |
403 | GroupReplicationNotSupport.InvalidEngineVersion | Group Replication requires the instance engine version to be 8.0. | The error message returned because the major engine version of the instance is not MySQL 8.0 and group replication is not supported. |
403 | GroupReplicationNotSupport.InvalidNodeClassCode | Group Replication requires the ClassCode of each node to be consistent. | The error message returned because the specifications of the nodes in the instance are different and group replication is not supported. |
403 | GroupReplicationNotSupport.InvalidNodeNum | Group Replication is not supported, the number of nodes must be an odd number greater than or equal to 3. | The error message returned because the number of nodes in the instance is not an odd number greater than 3 and group replication is not supported. |
403 | GroupReplicationNotSupport.InvalidXengine | Group Replication is not supported because the instance has xengine tables. | The error message returned because X-Engine tables exist in the instance and group replication is not supported. |
403 | GroupReplicationNotSupport.MemoryTooSmall | Group Replication is not supported because the memory is too small. | The error message returned because the memory capacity of the instance is small and MySQL group replication is not supported. |
403 | IncorrectMinorVersion | Current engine minor version does not support operations. | The error message returned because this operation is not supported for the current minor engine version. |
For a list of error codes, see Service error codes.