All Products
Search
Document Center

AnalyticDB:CreateDBInstance

Last Updated:Aug 02, 2026

Creates an AnalyticDB for PostgreSQL instance.

Operation description

Before you call this operation, make sure that you fully understand the billing methods and pricing of AnalyticDB for PostgreSQL.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

gpdb:CreateDBInstance

create

*DBInstance

acs:gpdb:{#regionId}:{#accountId}:dbinstance/*

  • gpdb:EncryptionType
  • gpdb:SSLEnabled
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

Note

You can call the DescribeRegions operation to query available region IDs.

cn-hangzhou

ZoneId

string

Yes

The zone ID.

Note

You can call the DescribeRegions operation to query available zone IDs.

cn-hangzhou-i

EngineVersion

string

Yes

The database engine version. Valid values:

  • 6.0: version 6.0.

  • 7.0: version 7.0.

6.0

Engine

string

Yes

The database engine. Set the value to gpdb.

gpdb

DBInstanceClass

string

No

The instance specifications. For more information, see the supplementary description of the DBInstanceClass parameter.

Note

This parameter is required when you create a storage reservation mode instance.

gpdb.group.segsdx1

DBInstanceGroupCount

string

No

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

Note

This parameter is required when you create a storage reservation mode instance.

2

DBInstanceDescription

string

No

The description of the instance.

test

SecurityIPList

string

No

The IP address whitelist.

A value of 127.0.0.1 indicates that no external IP addresses are allowed to access the instance. After the instance is created, you can call the ModifySecurityIps operation to modify the IP address whitelist.

127.0.0.1

PayType

string

No

The billing method. Valid values:

  • Postpaid: pay-as-you-go.

  • Prepaid: subscription.

Note
  • If you do not specify this parameter, the default value is pay-as-you-go.

  • Discounts are available for subscription instances when you purchase them for one year or longer. Select a billing method based on your business requirements.

Prepaid

Period

string

No

The unit of the subscription duration. Valid values:

  • Month: month.

  • Year: year.

Note

This parameter is required when you create a subscription instance.

Month

UsedTime

string

No

The subscription duration. Valid values:

  • If Period is set to Month, valid values are 1 to 9.

  • If Period is set to Year, valid values are 1 to 3.

Note

This parameter is required when you create a subscription instance.

1

ClientToken

string

No

The client token used for idempotence checks. For more information, see How to ensure idempotence.

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

InstanceNetworkType

string

No

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

Note
  • Only VPC is supported on the public cloud.

  • If you do not specify this parameter, the default value is VPC.

VPC

VPCId

string

No

The VPC ID.

Note
  • VPCId is required.

  • The VPC must be in the same region as the value specified by RegionId.

vpc-bp19ame5m1r3oejns****

VSwitchId

string

No

The vSwitch ID.

Note
  • vSwitchId is required.

  • The vSwitch must be in the same zone as the value specified by ZoneId.

vsw-bp1cpq8mr64paltkb****

PrivateIpAddress

string

No

[Deprecated] This parameter is deprecated. You do not need to specify this parameter.

null

SegStorageType

string

No

The cloud disk storage type. Currently, only ESSD cloud disks are supported. Set the value to cloud_essd.

Note

This parameter is required when you create a storage elastic mode instance.

cloud_essd

SegDiskPerformanceLevel

string

No

The performance level (PL) of the ESSD cloud disk. Valid values:

  • pl0: PL0.

  • pl1: PL1.

  • pl2: PL2.

Note
  • This parameter takes effect only when the cloud disk storage type is ESSD cloud disk.

  • If you do not specify this parameter, the default value is PL1.

pl1

InstanceSpec

string

No

The node specifications of compute nodes.

Valid values for storage elastic mode (high-availability edition):

  • 2C16G

  • 4C32G

  • 16C128G

Valid values for storage elastic mode (basic edition):

  • 2C8G

  • 4C16G

  • 8C32G

  • 16C64G

Valid values for Serverless mode:

  • 4C16G

  • 8C32G

Note

This parameter is required when you create a storage elastic mode instance or a Serverless mode instance.

2C16G

SegNodeNum

string

No

The number of compute nodes. Valid values:

  • Storage elastic mode (high-availability edition): 4 to 512. The value must be a multiple of 4.

  • Storage elastic mode (basic edition): 2 to 512. The value must be a multiple of 2.

  • Serverless mode: 2 to 512. The value must be a multiple of 2.

Note

This parameter is required when you create a storage elastic mode instance or a Serverless mode instance.

4

MasterNodeNum

string

No

[Deprecated] This parameter is deprecated. You do not need to specify this parameter.

null

DBInstanceMode

string

Yes

The resource type of the instance. Valid values:

  • StorageElastic: storage elastic mode.

  • Serverless: Serverless mode.

  • ServerlessPro: Serverless Pro mode.

  • Classic: storage reservation mode.

Note

This parameter is required.

StorageElastic

StorageType

string

No

[Deprecated] This parameter is deprecated. You do not need to specify this parameter.

null

DBInstanceCategory

string

No

The instance edition. Valid values:

  • HighAvailability: high-availability edition.

  • Basic: basic edition.

Note

This parameter is required when you create a storage elastic mode instance.

HighAvailability

ResourceGroupId

string

No

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

rg-bp67acfmxazb4p****

StorageSize

integer

No

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

Note

This parameter is required when you create a storage elastic mode instance.

200

CreateSampleData

boolean

No

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

  • true: Load a sample dataset.

  • false: Do not load a sample dataset.

Note

If you do not specify this parameter, the default value is false.

false

Tag

array<object>

No

The Nth tag. Valid values of N: 1 to 20.

object

No

The Nth tag. Valid values of N: 1 to 20.

Key

string

No

The tag key. The following limits apply:

  • 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 cannot contain http:// or https://.

TestKey

Value

string

No

The tag value. The following limits apply:

  • The tag value can be an empty string.

  • The tag value can be up to 128 characters in length.

  • The tag value cannot start with acs:, and cannot contain http:// or https://.

TestValue

ServerlessResource

integer

No

The compute resource threshold. Valid values: 16 to 1024. The step size is 8. Unit: ACU.

Note

This parameter is required only for Serverless instances in automatic scheduling mode.

16

IdleTime

integer

No

The idle release wait time. The instance transitions to an idle state after no service traffic is detected for the specified duration. Unit: seconds. Minimum value: 60. Default value: 600.

Note

This parameter is required only for Serverless instances in automatic scheduling mode.

600

ServerlessMode

string

No

The mode of the Serverless instance. Valid values:

  • Manual: manual scheduling. This is the default value.

  • Auto: automatic scheduling.

Note
  • This parameter is required only for Serverless mode instances.

  • The automatic scheduling mode for AnalyticDB for PostgreSQL Serverless is in invitational preview. To use this feature, submit a ticket to apply for access.

Auto

EncryptionType

string

No

The encryption type. Valid values:

  • NULL: Encryption is not enabled. This is the default value.

  • CloudDisk: Cloud disk encryption is enabled. Use the EncryptionKey parameter to specify the encryption key.

Note

Cloud disk encryption cannot be disabled after it is enabled.

CloudDisk

EncryptionKey

string

No

The encryption key ID.

Note

If the EncryptionType parameter is set to CloudDisk, specify the encryption key ID in the same region. Otherwise, leave this parameter empty.

0d2470df-da7b-4786-b981-88888888****

VectorConfigurationStatus

string

No

Specifies whether to enable vector engine optimization. Valid values:

  • enabled: Enable vector engine optimization.

  • disabled (default): Do not enable vector engine optimization.

Note
  • For mainstream analytics, data warehousing, and real-time data warehouse scenarios, do not enable vector engine optimization.

  • For scenarios that use the vector analysis engine for AIGC and AISearch, enable vector engine optimization.

enabled

MasterCU

integer

No

The master resources. Valid values:

  • 2 CU

  • 4 CU

  • 8 CU

  • 16 CU

  • 32 CU

Note

Master resources above 8 CU incur additional fees.

8 CU

SrcDbInstanceName

string

No

The ID of the source instance to clone.

Note

You can call the DescribeDBInstances operation to query the details of all AnalyticDB for PostgreSQL instances in the target region, including instance IDs.

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

BackupId

string

No

The backup set ID.

Note

You can call the DescribeDataBackups operation to query the backup set IDs of all backup sets for the target instance.

1111111111

EnableSSL

boolean

No

Indicates whether to enable Secure Sockets Layer (SSL) encryption. Valid values:

  • true: Enable SSL encryption.

  • false (default): Do not enable SSL encryption.

false

ProdType

string

No

The product type. Valid values:

  • standard: Standard Edition.

  • cost-effective: Economy Edition.

Note

If you do not specify this parameter, the default value is Standard Edition.

standard

DeployMode

string

No

The deployment mode. Valid values:

  • multiple: multi-zone deployment.

  • single: single-zone deployment.

Note
  • If you do not specify this parameter, the default value is single-zone deployment.

  • Currently, only single-zone deployment is supported.

single

StandbyZoneId

string

No

The secondary zone ID.

Note
  • This parameter is required only for multi-zone deployment.

  • You can call the DescribeRegions operation to query available zone IDs.

  • The secondary zone ID must be different from the primary zone ID.

cn-hangzhou-j

StandbyVSwitchId

string

No

The vSwitch ID in the secondary zone.

Note
  • This parameter is required only for multi-zone deployment.

  • The vSwitch must be in the same zone as the value specified by StandbyZoneId.

vsw-bp1cpq8mr64paltkb****

MasterAISpec

string

No

Specify this parameter if you want to change the master node to a MasterAI node.

Note
  • This parameter and MasterCU cannot be specified at the same time.

  • Only specific regions and zones support changing the master node to a MasterAI node.

  • Only basic edition instances of AnalyticDB for PostgreSQL 7.0 support MasterAI nodes.

  • You can view all valid values of this parameter on the specification change page for the master node.

ADB.AIMedium.2

AINodeSpecInfos

array<object>

No

The AI node specifications information.

object

No

The AI node specifications information.

AINodeNum

string

No

The number of AI nodes.

1

AINodeSpec

string

No

The AI node specifications.

ADB.AIMedium.2

CacheStorageSize

string

No

The Serverless cache storage size. Valid values: 800 to 102400. The step size is 32 GB. Unit: GB.

800

Supplementary description of the DBInstanceClass parameter

Currently, AnalyticDB for PostgreSQL supports the following two types of instance specifications:

  • High-performance: Specification names start with gpdb.group.segsdx. These specifications provide better I/O capabilities and higher performance.

  • High-capacity: Specification names start with gpdb.group.seghdx. These specifications provide larger and more cost-effective storage to meet higher storage requirements.

When you select instance specifications, select them based on your storage and computing requirements.

AnalyticDB for PostgreSQL also supports OSS-based external table extensions and data compression on external storage by using gzip. Data that does not need to participate in real-time computing can be stored in external storage to further reduce storage costs.

The following table describes the specifications of high-performance instances.


High-performance specification


CPU


Memory


Storage




gpdb.group.segsdx1


1 Core


8 GB


80 GB SSD


gpdb.group.segsdx2


2 Cores


16 GB


160 GB SSD


gpdb.group.segsdx16


16 Cores


128 GB


1.28 TB SSD

The following table describes the specifications of high-capacity instances.


High-capacity specification


CPU


Memory


Storage




gpdb.group.seghdx4


4 Cores


32 GB


2 TB HDD


gpdb.group.seghdx36


36 Cores


288 GB


18 TB HDD

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

DBInstanceId

string

The instance ID.

gp-bp12ga6v69h86****

Port

string

[Deprecated] This parameter is deprecated and no value is returned.

You can call the DescribeDBInstanceAttribute operation to query the port number of the instance.

3432

ConnectionString

string

[Deprecated] This parameter is deprecated and no value is returned.

You can call the DescribeDBInstanceAttribute operation to query the endpoint of the instance.

gp-bp12ga6v69h86****.gpdb.rds.aliyuncs.com

OrderId

string

The order ID.

111111111111

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.