You can call this operation to create an ApsaraDB for RDS instance.

Before you call this operation, make sure that you have fully understood the billing methods and pricing of ApsaraDB for RDS.

For information about ApsaraDB for RDS instance types, see Primary 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.

DBInstanceClass String Yes rds.mysql.s1.small

The instance type. For more information, see Primary instance types.

DBInstanceNetType String Yes Internet

The network connection type of the instance. Valid values:

  • Internet: specifies to connect to the instance over the Internet.
  • Intranet: specifies to connect to the instance over an internal network.
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:

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

The version of the database engine. Valid values:

  • MySQL: 5.5, 5.6, 5.7, and 8.0
  • SQL Server: 2008r2, 2012, 2012_ent_ha, 2012_std_ha, 2012_web, 2016_ent_ha, 2016_std_ha, 2016_web, 2017_std_ha, and 2017_ent
  • PostgreSQL: 9.4, 10.0, 11.0, and 12.0
  • PPAS: 9.3 and 10.0
  • MariaDB: 10.3
PayType String Yes Postpaid

The billing method of the instance. Valid values:

  • Postpaid: specifies to use pay-as-you-go billing.
  • Prepaid: specifies to use subscription billing.
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. If you enter more than one IP address, separate them with commas (,). Every IP address in the whitelist must be unique. The whitelist can contain up to 1,000 IP addresses. You can add IP addresses in one of the following two formats:

  • IP address, such as 10.23.12.24.
  • Classless Inter-Domain Routing (CIDR) blocks, 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. This parameter has been phased out.

DBInstanceDescription String No testdatabase

The description of the instance. The description must be 2 to 255 characters in length. It can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.

Note The description 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 only contain ASCII characters and cannot exceed 64 characters in length.

ZoneId String No cn-hangzhou-b

The ID of the zone. If the instance spans more than one zone, the value of this parameter contains an MAZ part such as cn-hangzhou-MAZ6(b,f) and cn-hangzhou-MAZ5(b,e,f). You can call the DescribeRegions operation to query the most recent zone list.

Note If you specify a VPC and a VSwitch, you must also specify this parameter.
InstanceNetworkType String No Classic

The network type of the instance. Valid values:

  • VPC
  • Classic

The default network type is Classic.

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.

The system automatically assigns an access mode.

Note ApsaraDB RDS for 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 to which the instance belongs.

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 private IP address of the instance. The private IP address must fall within the Classless Inter-Domain Routing (CIDR) block supported by the specified VSwitch. The system automatically assigns an IP address based on the VPCId and VSwitchId parameters.

UsedTime String No 2

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

  • If you set the Period parameter to Year, the value of the UsedTime parameter ranges from 1 to 3.
  • If you set the Period parameter to Month, the value of the UsedTime parameter ranges from 1 to 9.
Note This parameter must be specified if the PayType parameter is set to Prepaid.
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.
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:

  • local_ssd: specifies to use local SSDs. This is the recommended storage type.
  • cloud_ssd: specifies to use standard SSDs.
  • cloud_essd: specifies to use enhanced SSDs.
BusinessInfo String No 121436975448952

The extended business information of the instance.

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

The ID of the encryption key that is used to encrypt data on SSDs in the region. You can view the encryption key ID in the Key Management Service (KMS) console. You can also create an encryption 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) provided to the service account of the instance by your Alibaba Cloud account to connect to KMS. You can copy the ARN from the RAM console.

Note For 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
  • Monthly subscription: The auto-renewal cycle is one month.
  • Annual subscription: The auto-renewal cycle is one year.
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 ID of the host group to which the instance belongs if you create an instance in a host group.

TargetDedicatedHostIdForMaster String No i-bpxxxxxxx1

The ID of the host to which the instance belongs if you create a primary instance in a host group.

TargetDedicatedHostIdForSlave String No i-bpxxxxxxx2

The ID of the host to which the instance belongs if you create a secondary instance in a host group.

TargetDedicatedHostIdForLog String No i-bpxxxxxxx3

The ID of the host to which the instance belongs if you create a log instance in a host group.

Note You cannot specify this parameter.
DBParamGroupId String No rpg-sys-xxxx

The ID of the parameter template used by the instance.

DBTimeZone String No UTC+08:00

The UTC time zone of the instance. Valid values: UTC-12:00 to UTC+12:00. The time zone must be an integer value such as UTC+08:00. Values such as UTC+08:30 are not allowed.

Note If you do not specify this parameter, the system assigns the default time zone of the region to which the instance belongs.
DBIsIgnoreCase String No 1

Specifies whether table names are case-sensitive. Valid values:

  • 1: Table names are not case-sensitive. This is the default value.
  • 0: Table names are case-sensitive.

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

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

The port used to connect to 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

{
    "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 zone does not support the 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 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 account does not have a valid payment method. Add a valid payment method and try again.

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