All Products
Search
Document Center

AnalyticDB for PostgreSQL:CreateDBInstance

Last Updated:Mar 03, 2024

Creates an AnalyticDB for PostgreSQL instance.

Operation description

You can call this operation when you need to create AnalyticDB for PostgreSQL instances to meet the requirements of new applications or services.

Before you call this operation, make sure that you are familiar with the billing of AnalyticDB for PostgreSQL instances. For more information, see Billing methods and AnalyticDB for PostgreSQL pricing.

Limits

You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds a limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limits when you call this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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
gpdb:CreateDBInstanceWrite
  • DBInstance
    acs:gpdb:{#regionId}:{#accountId}:dbinstance/*
  • gpdb:EncryptionType
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ZoneIdstringYes

The zone ID of the read-only instance. You can call the DescribeRegions operation to query the most recent zone list.

cn-hangzhou-i
EngineVersionstringYes

The version of the database engine. Valid values:

  • 6.0
  • 7.0
6.0
EnginestringYes

The database engine of the instance. Set the value to gpdb.

gpdb
DBInstanceClassstringNo

The instance type of the instance. For information, see Instance types.

Note This parameter must be specified when you create an instance in reserved storage mode.
gpdb.group.segsdx1
DBInstanceGroupCountstringNo

The number of compute groups. Valid values: 2, 4, 8, 12, 16, 24, 32, 64, 96, and 128.

Note This parameter must be specified when you create an instance in reserved storage mode.
2
DBInstanceDescriptionstringNo

The description of the instance.

test
SecurityIPListstringYes

The IP address whitelist of the instance.

A value of 127.0.0.1 specifies that no IP address is allowed for external access. You can call the ModifySecurityIps operation to modify the IP address whitelist after you create an instance.

127.0.0.1
PayTypestringNo

The billing method of the instance. Valid values:

  • Postpaid: pay-as-you-go.
  • Prepaid: subscription.
Note
  • If you do not specify this parameter, Postpaid is used.

  • You can obtain more cost savings if you create a subscription instance for one year or longer. We recommend that you select the billing method that best suits your needs.

Prepaid
PeriodstringNo

The unit of the subscription duration. Valid values:

  • Month
  • Year
Note This parameter must be specified when PayType is set to Prepaid.
Month
UsedTimestringNo

The subscription duration.

  • Valid values when Period is set to Month: 1 to 9.
  • Valid values when Period is set to Year: 1 to 3.
Note This parameter must be specified when PayType is set to Prepaid.
1
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. For more information, see Ensure idempotence.

0c593ea1-3bea-11e9-b96b-88**********
InstanceNetworkTypestringNo

The network type of the instance. Set the value to VPC.

Note
  • Only the Virtual Private Cloud (VPC) type is supported in Alibaba Cloud public cloud.

  • If you do not specify this parameter, VPC is used.

VPC
VPCIdstringNo

The VPC ID of the instance.

Note
  • This parameter must be specified.

  • The region where the VPC resides must be the same as the region that is specified by RegionId.

vpc-bp*******************
VSwitchIdstringNo

The vSwitch ID of the instance.

Note
  • This parameter must be specified.

  • The zone where the vSwitch resides must be the same as the zone that is specified by ZoneId.

vsw-bp*******************
PrivateIpAddressstringNo

This parameter is no longer used.

1.1.1.*
SegStorageTypestringNo

The disk storage type of the instance. Only enhanced SSDs (ESSDs) are supported. Set the value to cloud_essd.

Note This parameter must be specified when you create an instance in elastic storage mode.
cloud_essd
SegDiskPerformanceLevelstringNo

The performance level of ESSDs. Valid values:

  • pl0
  • pl1
  • pl2
Note
  • This parameter takes effect only when SegStorageType is set to cloud_essd.

  • If you do not specify this parameter, pl1 is used.

pl1
InstanceSpecstringNo

The specifications of compute nodes.

Valid values for High-availability Edition instances in elastic storage mode:

  • 2C16G
  • 4C32G
  • 16C128G

Valid values for Basic Edition instances in elastic storage mode:

  • 2C8G
  • 4C16G
  • 8C32G
  • 16C64G

Valid values for instances in Serverless mode:

  • 4C16G
  • 8C32G
Note This parameter must be specified when you create an instance in elastic storage mode or Serverless mode.
2C16G
SegNodeNumstringNo

The number of compute nodes.

  • Valid values for High-availability Edition instances in elastic storage mode: multiples of 4 in the range of 4 to 512.
  • Valid values for Basic Edition instances in elastic storage mode: multiples of 2 in the range of 2 to 512.
  • Valid values for instances in Serverless mode: multiples of 2 in the range of 2 to 512.
Note This parameter must be specified when you create an instance in elastic storage mode or Serverless mode.
4
MasterNodeNumstringNo

This parameter is no longer used.

1
DBInstanceModestringYes

The resource type of the instance. Valid values:

  • StorageElastic: elastic storage mode.
  • Serverless: Serverless mode.
  • Classic: reserved storage mode.
Note This parameter must be specified.
StorageElastic
StorageTypestringNo

This parameter is no longer used.

null
DBInstanceCategorystringNo

The edition of the instance. Valid values:

  • HighAvailability: High-availability Edition.
  • Basic: Basic Edition.
Note This parameter must be specified when you create an instance in elastic storage mode.
HighAvailability
ResourceGroupIdstringNo

The ID of the resource group to which the instance belongs.

rg-bp67acfmxazb4p****
StorageSizelongNo

The storage capacity of the instance. Unit: GB. Valid values: 50 to 6000.

Note This parameter must be specified when you create an instance in elastic storage mode.
200
CreateSampleDatabooleanNo

Specifies whether to load a sample dataset after the instance is created. Valid values:

  • true
  • false
Note If you do not specify this parameter, no sample dataset is loaded.
false
Tagobject []No

The list of tags.

KeystringNo

The key of tag N. Take note of the following requirements:

  • The tag key cannot be an empty string.
  • The tag key can be up to 128 characters in length.
  • The tag key cannot start with aliyun or acs:, and contain http:// or https://.
TestKey
ValuestringNo

The value of tag N. Take note of the following requirements:

  • The tag key cannot be an empty string.
  • The tag key can be up to 128 characters in length.
  • The tag key cannot start with aliyun or acs:, and contain http:// or https://.
TestValue
ServerlessResourceintegerNo

The threshold of computing resources. Unit: AnalyticDB compute unit (ACU). Valid values: 8 to 32. The value must be in increments of 8 ACUs. Default value: 32.

Note This parameter must be specified only when you create an instance in automatic Serverless mode.
32
IdleTimeintegerNo

The wait time for the instance that has no traffic to become idle. Minimum value: 60. Default value: 600. Unit: seconds.

Note This parameter must be specified only when you create an instance in automatic Serverless mode.
600
ServerlessModestringNo

The type of the Serverless mode. Valid values:

  • Manual (default): manual scheduling.
  • Auto: automatic scheduling.
Note This parameter must be specified only when you create an instance in Serverless mode.
Auto
EncryptionTypestringNo

The encryption type. Valid values:

  • NULL (default): Encryption is disabled.
  • CloudDisk: Encryption is enabled on cloud disks, and EncryptionKey is used to specify an encryption key.
Note Disk encryption cannot be disabled after it is enabled.
CloudDisk
EncryptionKeystringNo

The ID of the encryption key.

Note If EncryptionType is set to CloudDisk, you must specify an encryption key that resides in the same region as the cloud disk that is specified by EncryptionType. Otherwise, leave this parameter empty.
0d2470df-da7b-4786-b981-88888888****
VectorConfigurationStatusstringNo

Specifies whether to enable vector search engine optimization. Valid values:

  • enabled
  • disabled (default)
Note
  • We recommend that you do not enable vector search engine optimization in mainstream analysis, data warehousing, and real-time data warehousing scenarios.

  • We recommend that you enable vector search engine optimization in AI-generated content (AIGC) and vector retrieval scenarios that require the vector analysis engine.

enabled
MasterCUintegerNo

The amount of coordinator node resources. Valid values:

  • 2 CU
  • 4 CU
  • 8 CU
  • 16 CU
  • 32 CU
Note You are charged for coordinator node resources of more than 8 CUs.
8 CU
SrcDbInstanceNamestringNo

The ID of the source instance.

Note You can call the DescribeDBInstances operation to query the information about all AnalyticDB for PostgreSQL instances within a region, including instance IDs.
gp-bp***************
BackupIdstringNo

The ID of the backup set.

Note You can call the DescribeDataBackups operation to query the IDs of all backup sets in the instance.
1111111111

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

5414A4E5-4C36-4461-95FC-************
DBInstanceIdstring

The instance ID.

gp-bp***************
Portstring

An invalid parameter. It is no longer returned when you call this operation.

You can call the DescribeDBInstanceAttribute operation to query the port number that is used to connect to the instance.

5432
ConnectionStringstring

An invalid parameter. It is no longer returned when you call this operation.

You can call the DescribeDBInstanceAttribute operation to query the endpoint that is used to connect to the instance.

gp-bp***************.gpdb.rds.aliyuncs.com
OrderIdstring

The order ID.

111111111111

Examples

Sample success responses

JSONformat

{
  "RequestId": "5414A4E5-4C36-4461-95FC-************",
  "DBInstanceId": "gp-bp***************",
  "Port": "5432",
  "ConnectionString": "gp-bp***************.gpdb.rds.aliyuncs.com",
  "OrderId": "111111111111"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-01-04The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: ProdType
2023-12-18The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: EnableSSL
2023-09-18The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-08-17The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: MasterCU
2023-08-17The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: SrcDbInstanceName
    Added Input Parameters: BackupId
2023-05-23The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: VectorConfigurationStatus
2023-05-04The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: EncryptionType
    Added Input Parameters: EncryptionKey
2023-04-18The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: SegDiskPerformanceLevel