You can call this operation to create an RDS instance.

Before performing this operation, make sure that you fully understand the billing methods and pricing of RDS.

For more information about RDS instance types, see Instance types.

Debugging

You can use API Explorer to perform debugging.

API Explorer provides various functions to simplify API usage. For example, you can search APIs, call APIs, and generate SDK sample code.

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 ID of the region. You can call DescribeRegions to view the available regions of Alibaba Cloud.

Engine String Yes MySQL

The engine type of the database. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • PPAS
  • MariaDB
EngineVersion String Yes 5.6

The version of the database. Valid values:

  • MySQL: 5.5/5.6/5.7/8.0
  • SQL Server: 2008r2/2012/2012_ent_ha/2012_std_ha/2012_web/2016_ent_ha/2016_std_ha/2016_web/2017_ent
  • PostgreSQL: 9.4/10.0
  • PPAS: 9.3/10.0
  • MariaDB: 10.3
DBInstanceClass String Yes rds.mysql.s1.small

The instance type (specifications). For more information, see Instance types.

DBInstanceStorage Integer Yes 20

The storage capacity of the instance. Valid values:

  • MySQL/PostgreSQL/PPAS High-availability Edition: 5 to 2000
  • MySQL 5.7 with cloud SSDs or MariaDB: 20 to 1000
  • SQL Server 2008 R2: 10 to 2000
  • SQL Server 2012, 2016, or 2017: 20 to 3000

This value must be a multiple of 5. Unit: GB. For more information, see Instance types.

DBInstanceNetType String Yes Internet

The network type of the instance. Valid values:

  • Internet
  • Intranet
PayType String Yes Postpaid

The billing method of the instance. Valid values:

  • Postpaid: Pay-As-You-Go
  • Prepaid: Subscription
SecurityIPList String Yes 10.23.12.27/24

The IP whitelist of the instance. Separate multiple IP addresses with commas (,). It can include up to 1,000 IP addresses. The IP addresses support two formats:

  • IP address format, such as, 10.23.12.24.
  • Classless Inter-Domain Routing (CIDR) format, such as, 10.23.12.24/24 (where /24 indicates the number of bits for the prefix of the IP address, in the range of 1 to 32.)
SystemDBCharset String No GBK

The character set. Valid values:

  • MySQL or MariaDB: utf8, gbk, latin1, or utf8mb4
  • SQL Server: Chinese_PRC_CI_AS, Chinese_PRC_CS_AS, SQL_Latin1_General_CP1_CI_AS, SQL_Latin1_General_CP1_CS_AS, and Chinese_PRC_BIN
DBInstanceDescription String No Test database

The instance description. It starts with a letter and contains 2 to 256 characters, including letters, digits, underscores (_), and hyphens (-).

Note It cannot start with http:// or https://.
ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxxxxx

The client token that is used to ensure the idempotency of requests. The parameter value is generated by the client and is unique among different requests, which is a string of up to 64 ASCII characters.

ZoneId String No cn-hangzhou-b

The ID of the zone.

InstanceNetworkType String No Classic

The network type of the instance. Valid values:

  • VPC
  • Classic (default value)
Note
  • SQL Server 2017 Cluster Edition supports only the VPC network.
  • For MariaDB, this parameter is required.
ConnectionMode String No Standard

The access mode of the instance. Valid values:

  • Standard: standard mode
  • Safe: database proxy mode
Note SQL Server 2012, 2016, and 2017 support only the standard mode.
VPCId String No vpc-xxxxxxxxxxxx

The ID of the VPC.

Note For MariaDB, this parameter is required.
VSwitchId String No vsw-xxxxxxxxxxx

The ID of the VSwitch. Separate multiple IDs with commas (,).

Note For MariaDB, this parameter is required.
PrivateIpAddress String No 172.16.201.69

The intranet IP address of the instance. It must be within the IP address range provided by the switch. By default, the system automatically assigns an IP address based on VPCId and VSwitchId.

Period String No Year

The prepayment period of the instance. Valid values:

  • Year
  • Month
Note If the billing method is Prepaid, this parameter is required.
UsedTime String No 2

The subscription length. Valid values:

  • If Period is set to Year, UsedTime can be 1 to 3.
  • If Period is set to Month, UsedTime can be 1 to 9.
Note If the billing method is Prepaid, this parameter is required.
AutoRenew String No true
Whether the instance will be automatically renewed. Valid values:
  • true
  • false
Note
  • If Period is set to Year, the automatic renewal period is 1 year.
  • If Period is set to Month, the automatic renewal period is 1 month.
DBInstanceStorageType String No cloud_ssd

The storage type of the instance. Valid values:

  • local_ssd: local SSD (recommended).
  • cloud_ssd: cloud SSD.
BusinessInfo String No 121436975448952

The extended business information.

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 intranet address of the database.

Port String 3306

The intranet port of the database.

RequestId String 1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC

The ID of the request.

Examples

Request example


http(s)://rds.aliyuncs.com/?Action=CreateDBIsnstance
&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>

Normal response examples

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

{
	"Port":"3306",
	"ConnectionString":"rm-uf6wjk5xxxxxxx.mysql.rds.aliyuncs.com",
	"RequestId":"1E43AAE0-BEE8-43DA-860D-EAF2AA0724DC",
	"DBInstanceId":"rm-uf6wjk5xxxxxxx",
	"OrderId":"1007893702xxxxx"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidZoneId.NotSupported The Specified vpc Zone not supported. The zone does not support VPC instances. Change the zone and retry.

View error codes