All Products
Search
Document Center

ApsaraDB for SelectDB:CreateDBInstance

Last Updated:May 14, 2025

Creates an ApsaraDB for SelectDB instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
selectdb:CreateDBInstancecreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceGroupIdstringNo

The resource group ID.

rg-aekzt2zaluvuvqa_fake
ClientTokenstringNo

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 make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

AB
EnginestringNo

The database engine of the instance. Default value: selectdb.

selectdb
EngineVersionstringYes

The database engine version of the instance. Default value: 3.0.

2.4
ChargeTypestringYes

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go
  • Prepaid: subscription
PrePaid
UsedTimeintegerNo

The subscription duration of the instance. Valid values:

  • If Period is set to Year, valid values of UsedTime are 1, 2, 3, 4, and 5.
  • If Period is set to Month, valid values of UsedTime are 1 to 12.
Note This parameter takes effect and is required only when ChargeType is set to Prepaid.
1
PeriodstringNo

The unit of the subscription duration of the cluster. Valid values:

  • Year: subscription on a yearly basis.
  • Month: subscription on a monthly basis.
Note This parameter takes effect and is required only when ChargeType is set to Prepaid.
Month
DBInstanceClassstringYes

The instance type. You can call the DescribeAllDBInstanceClass operation to query instance types.

selectdb.xlarge
RegionIdstringYes

The region ID.

cn-hangzhou
ZoneIdstringYes

The zone ID.

cn-hangzhou-e
CacheSizeintegerYes

The reserved cache size.

200GB
VpcIdstringYes

The virtual private cloud (VPC) ID.

vpc-bp175iuvg8nxqraf2****
VSwitchIdstringYes

The vSwitch ID.

vsw-bp1gzt31twhlo0sa5****
DBInstanceDescriptionstringNo

The instance description.

The instance is created for testing.
ConnectionStringstringNo

The instance endpoint.

selectdb-cn-7213c8y****-public.selectdbfe.pre.rds.aliyuncs.com
SecurityIPListstringNo

The IP addresses in the whitelist of the instance. Separate multiple IP addresses with commas (,).

192.168.1.1
Tagarray<object>No

The instance tags.

objectNo

The details of the instance tag.

KeystringNo

The tag key.

testKey
ValuestringNo

The tag value.

testValue
DeploySchemestringNo

The deployment method of the instance.

Valid values:

  • multi_az
  • single_az
single_az
MultiZonearray<object>No

The configurations of multi-zone deployment.

Note
  • This parameter takes effect and is required only when DeployScheme is set to multi_az.
objectNo

The zones.

ZoneIdstringNo

The zone ID.

cn-hangzhou-k
VSwitchIdsarrayNo

The vSwitch IDs.

stringNo

The vSwitch ID.

vsw-bp10dbralpn4bzmgkkh8f
AddVPCIPsstringNo

Specifies whether to add the virtual private cloud (VPC) CIDR block to the IP address whitelist. Valid values:

  • 1: yes.
  • 0: no.
1

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

4773E4EC-025D-509F-AEA9-D53123FDFB0F
Dataobject

The returned result.

DBInstanceIdstring

The instance ID.

selectdb-cn-7213cjv****
OrderIdlong

The order ID.

21137950671****

Examples

Sample success responses

JSONformat

{
  "RequestId": "4773E4EC-025D-509F-AEA9-D53123FDFB0F",
  "Data": {
    "DBInstanceId": "selectdb-cn-7213cjv****",
    "OrderId": 0
  }
}

Error codes

HTTP status codeError codeError messageDescription
400COMMODITY.INVALID_COMPONENTOrder configuration parameters do not meet the verification conditions, please re-match the product.Order configuration parameters do not meet the verification conditions, please re-match the product!
400DocumentConvertFailed.ExceedFileSizeLimitThe conversion has been failed, exceed file size limit.english description1
400ForbiddenUser not authorized to operate on the specified resource, or this API does not support RAM.english description1
400InvalidDBNameThe specified database name is not allowed.english description1
400CreateOrderFailedFailed to create order.Failed to create order.
400InvalidVSwitchId.MalformedThe specified parameter "VSwitchId" is not valid.The parameter VSwitchId is invalid.
400InvalidMultiZone.NotThreeZonesThe number of zones must be three.The number of multi-availability zones must be three.
400InvalidZoneId.DuplicatedThe zones cannot be repeated please select different zones.The selected Availability Zone cannot be duplicated
400EngineVersionDoNotSupportMultiZoneThe specified engine version doesn't support multi zone.The specified version does not support the multi_az deploy scheme.
403DBClusterNotSupportedThe requested operation can not be performed while the cluster is not sale.The requested operation cannot be performed while the cluster is not running.
403IncorrectDBInstanceStateCurrent DB instance state does not support this operation.english description1
403InstanceEngineType.NotSupportThe instance engine and type does not support operations.english description1
403InvalidDBInstanceState.NotSupportThe specified instance state does't support this operation.The instance is in a state that does not support the current operation.
403MoneyLessThan100The Account Monet less Than 100.english description1
403OperationDenied.DBNameAndAccountPrivilegeCountThe operation is not permitted due to count of database or account privilege.english description1
403InsufficientResourceCapacityThe resource is out of usage.Not enough resources, please try again later.
404DBInstanceLockedThe current instance lock mode does not support this operation.english description1
404IncorrectVswitchIdThe specified parameter VSwitchId is not valid.english description1
404InvalidApi.NotFoundSpecified api is not found, please check your url and method.-
404InvalidDBInstance.NotFoundThe specified instance is not found.english description1
404InvalidDBInstanceClass.NotFoundThe specified instance classic does not exist.english description1
404InvalidRegionId.NotFoundThe provided RegionId does not exist in our records.english description1
404QueryPrice.FailedThe inquiry failed. Contact Alibaba Cloud customer service representatives.english description1
404InvalidVSwitch.NoIPVSwitch has zero available IP.VSwitch has zero available IP.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-12The Error code has changedView Change Details
2024-06-12The Error code has changed. The request parameters of the API has changedView Change Details
2023-12-27The Error code has changed. The request parameters of the API has changedView Change Details