Creates an ApsaraDB for RDS instance.

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

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 the instance runs. Valid values:

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

The version of the database engine that the instance runs. 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. For more information, see Instance types.

DBInstanceStorage Integer Yes 20

The storage capacity of the instance. Unit: GB. The storage capacity increases at increments of 5 GB. For more information, see Instance types.

DBInstanceNetType String Yes Internet

The network connection type of the instance. Valid values:

  • Internet
  • Intranet
PayType String Yes Postpaid

The billing method of the instance. Valid values:

  • Postpaid: specifies to use the pay-as-you-go billing method.
  • Prepaid: specifies to use the subscription billing method.
SecurityIPList String Yes 10.23.12.27/24

The IP address whitelist of the instance. If the whitelist contains more than one IP address, separate them with commas (,). Every IP address in the whitelist must be unique. The whitelist can contain a maximum of 1,000 IP addresses. You can add IP addresses in one of the following two formats:

  • IP address. Example: 10.23.12.24.
  • Classless Inter-Domain Routing (CIDR) block, such as 10.23.12.24/24, where 24 indicates that the prefix of the CIDR block is 24-bit. You can replace 24 with a value ranging from 1 to 32.
SystemDBCharset String No GBK

The character set of the instance. Valid values:

  • MySQL and MariaDB: utf8 | gbk | latin1 | utf8mb4.
  • SQL Server: Chinese_PRC_CI_AS | Chinese_PRC_CS_AS | SQL_Latin1_General_CP1_CI_AS | SQL_Latin1_General_CP1_CS_AS | Chinese_PRC_BIN.
Note The PostgreSQL database engine requires you to specify a character set when creating a database. You do not need to specify this parameter when you create an ApsaraDB RDS for PostgreSQL instance.
DBInstanceDescription String No testdatabase

The name of the instance. The name must be 2 to 256 characters in length. It can contain letters, digits, underscores (_), and hyphens (-).

Note It must start with a letter but 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 make sure 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 zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list.

Note This parameter must be specified when you specify the VPC and VSwitch of the instance.
InstanceNetworkType String No Classic

The network type of the instance. Valid values:

  • VPC
  • Classic

By default, the Classic Network type is used for the instance.

Note
  • SQL Server 2017 in the Cluster Edition only supports the VPC network type.
  • This parameter must be specified when you create an ApsaraDB RDS for MariaDB instance.
ConnectionMode String No Standard

The access mode of the instance. Valid values:

  • Standard: specifies to use the standard mode.
  • Safe: specifies to use the database proxy mode.

By default, the access mode assigned by the system is used.

Note SQL Server 2012, SQL Server 2016, and SQL Server 2017 only support the standard mode.
VPCId String No vpc-xxxxxxxxxxxx

The ID of the VPC.

Note This parameter must be specified when you create an ApsaraDB RDS for MariaDB instance.
VSwitchId String No vsw-xxxxxxxxxxx

The ID of the VSwitch associated with the specified VPC. If the value of this parameter contains more than one VSwitch ID, separate them with commas (,).

Note This parameter must be specified when you create an ApsaraDB RDS for MariaDB instance.
PrivateIpAddress String No 172.16.201.69

The internal IP address of the instance. The internal IP address must fall within the specified VSwitch IP address range. By default, the system automatically assigns an IP address based on the VPCId and VSwitchId parameters.

Period String No Year

The renewal period of the instance if the instance uses subscription billing. Valid values:

  • Year
  • Month
Note This parameter must be specified if the value of the PayType parameter is Prepaid.
UsedTime String No 2

The duration of the instance if the instance uses subscription billing. Valid values:

  • If the value of the Period parameter is Year, the value of the UsedTime parameter ranges from 1 to 3.
  • If the value of the Period parameter is Month, the value of the UsedTime parameter ranges from 1 to 9.
Note This parameter must be specified if the value of the PayType parameter is Prepaid.
AutoRenew String No true

Specifies whether to enable auto-renewal. Valid values: true | false.

Note
  • Monthly subscription: The auto-renewal cycle is one month.
  • Annual subscription: The auto-renewal cycle is one year.
DBInstanceStorageType String No cloud_ssd

The storage type of the instance. Valid values:

  • local_ssd: specifies to use local SSDs. This value is recommended.
  • cloud_ssd: specifies to use standard SSDs.
  • cloud_essd: specifies to use enhanced SSDs (ESSDs).
BusinessInfo String No 121436975448952

The extended business information of the instance.

Category String No HighAvailability

The edition of the instance. Valid values:

  • Basic: specifies to use the Basic Edition.
  • HighAvailability: specifies to use the High-availability Edition.
  • AlwaysOn: specifies to use the Cluster Edition.
  • Finance: specifies to use the Enterprise Edition.
DedicatedHostGroupId String No dhg-4nxxxxxxx

The host group ID of the instance.

EncryptionKey String No 0d24xxxx-da7b-4786-b981-9a164dxxxxxx

The encryption key ID used to encrypt data on SSDs in the specified region. You can view the encryption key ID in the Key Management Service (KMS) console or create a new encryption key ID. For more information, see Manage CMKs.

Note If this parameter is specified, SSD encryption is enabled and the RoleARN parameter must also be specified. Note that SSD encryption cannot be disabled once it is enabled.
RoleARN String No acs:ram::1406xxxxxx:role/aliyunrdsinstanceencryptiondefaultrole

The Amazon Resource Name (ARN) provided for your database account by Alibaba Cloud to connect to KMS. You can copy the ARN in the RAM console.

Note For information about how to grant your database account the permissions to connect to KMS in the RAM console, see Authorize ApsaraDB for RDS to connect to KMS.
TargetDedicatedHostIdForLog String No i-bpxxxxxxx3

The host ID of the log instance.

Note You cannot specify this parameter.
TargetDedicatedHostIdForMaster String No i-bpxxxxxxx1

The host ID of the primary instance.

TargetDedicatedHostIdForSlave String No i-bpxxxxxxx2

The host ID of the secondary instance.

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 used to connect the instance.

Note The DBInstanceNetType parameter determines whether the endpoint is internal or public.
Port String 3306

The port used to connect the instance.

Note The DBInstanceNetType parameter determines 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

{
	"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 error message returned because the zone does not support the VPC instance. Change the zone and try again.

For a list of error codes, visit the API Error Center.