CreateDBInstance

更新时间:
复制 MD 格式

Create an AnalyticDB for PostgreSQL instance.

Operation description

Before you call this operation, review the billing methods and pricing for 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 ID of the region for the instance.

Note

You can call the DescribeRegions operation to query the IDs of available regions.

cn-hangzhou

ZoneId

string

Yes

The ID of the zone for the instance.

Note

You can call the DescribeRegions operation to query the IDs of available zones.

cn-hangzhou-i

EngineVersion

string

Yes

The database engine version. Valid values:

  • 6.0

  • 7.0

6.0

Engine

string

Yes

The database engine. Set the value to gpdb.

gpdb

DBInstanceClass

string

No

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

Note

This parameter is required for instances in reserved storage mode.

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 for instances in reserved storage mode.

2

DBInstanceDescription

string

No

The instance description.

test

SecurityIPList

string

No

The IP address whitelist for the instance.

A value of 127.0.0.1 blocks all external access. After you create the instance, you can call the ModifySecurityIps operation to modify the IP address whitelist.

127.0.0.1

PayType

string

No

The billing method for the instance. Valid values:

  • Postpaid: pay-as-you-go.

  • Prepaid: subscription.

Note
  • If this parameter is not specified, the default billing method is pay-as-you-go.

  • Discounts are available for subscriptions of one year or longer. Select a billing method based on your business needs.

Prepaid

Period

string

No

The unit of the subscription duration. Valid values:

  • Month

  • Year

Note

This parameter is required for subscription instances.

Month

UsedTime

string

No

The subscription duration. Valid values:

  • If Period is Month, the value can be an integer from 1 to 9.

  • If Period is Year, the value can be an integer from 1 to 3.

Note

This parameter is required for subscription instances.

1

ClientToken

string

No

A client token used to ensure the idempotence of the request. For more information, see How to ensure idempotence.

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

InstanceNetworkType

string

No

The instance network type. Set the value to VPC.

Note
  • Only VPCs are supported.

  • If this parameter is not specified, VPC is used by default.

VPC

VPCId

string

No

The VPC ID.

Note
  • This parameter is required.

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

vpc-bp19ame5m1r3oejns****

VSwitchId

string

No

The vSwitch ID.

Note
  • This parameter is required.

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

vsw-bp1cpq8mr64paltkb****

PrivateIpAddress

string

No

This parameter is deprecated.

null

SegStorageType

string

No

The storage type for the segment nodes. Only ESSDs are supported. Set the value to cloud_essd.

Note

This parameter is required for instances in elastic storage mode.

cloud_essd

SegDiskPerformanceLevel

string

No

The performance level of the ESSDs. Valid values:

  • pl0: PL0

  • pl1: PL1

  • pl2: PL2

Note
  • This parameter applies only if the segment node storage type is ESSD.

  • If this parameter is not specified, pl1 is used by default.

pl1

InstanceSpec

string

No

The instance type for the compute nodes.

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

  • 2C16G

  • 4C32G

  • 16C128G

Valid values for a Basic Edition instance in elastic storage mode:

  • 2C8G

  • 4C16G

  • 8C32G

  • 16C64G

Valid values for a serverless instance:

  • 4C16G

  • 8C32G

Note

This parameter is required for instances in elastic storage mode or serverless mode.

2C16G

SegNodeNum

string

No

The number of compute nodes. Valid values:

  • For a High-availability Edition instance in elastic storage mode, the value must be a multiple of 4, from 4 to 512.

  • For a Basic Edition instance in elastic storage mode, the value must be a multiple of 2, from 2 to 512.

  • For a serverless instance, the value must be a multiple of 2, from 2 to 512.

Note

This parameter is required for instances in elastic storage mode or serverless mode.

4

MasterNodeNum

string

No

This parameter is deprecated.

null

DBInstanceMode

string

Yes

The instance resource mode. Valid values:

  • StorageElastic: elastic storage mode

  • Serverless: serverless mode

  • Classic: reserved storage mode

Note

This parameter is required.

StorageElastic

StorageType

string

No

This parameter is deprecated.

null

DBInstanceCategory

string

No

The instance edition. Valid values:

  • HighAvailability: High-availability Edition

  • Basic: Basic Edition

Note

This parameter is required for instances in elastic storage mode.

HighAvailability

ResourceGroupId

string

No

The ID of the resource group for the instance.

rg-bp67acfmxazb4p****

StorageSize

integer

No

The storage capacity for the instance, in GB. Valid values: 50 to 8000.

Note

This parameter is required for instances in elastic storage mode.

200

CreateSampleData

boolean

No

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

  • true: A sample dataset is loaded.

  • false: A sample dataset is not loaded.

Note

If this parameter is not specified, a sample dataset is not loaded.

false

Tag

array<object>

No

The tags to add to the instance. You can add up to 20 tags.

object

No

The tags to add to the instance. You can add up to 20 tags.

Key

string

No

The tag key. The following limits apply:

  • The tag key cannot be empty.

  • 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 empty.

  • 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 threshold for computing resources, in AnalyticDB Compute Units (ACUs). The value must be a multiple of 8, ranging from 8 to 32. The default value is 32.

Note

This parameter is required only for serverless instances that use auto-scheduling.

32

IdleTime

integer

No

The period of inactivity, in seconds, after which the instance is considered idle. Minimum value: 60. Default value: 600.

Note

This parameter is required only for serverless instances that use auto-scheduling.

600

ServerlessMode

string

No

The mode of the serverless instance. Valid values:

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

  • Auto: auto-scheduling.

Note
  • This parameter is required only for instances in serverless mode.

  • Auto-scheduling for AnalyticDB for PostgreSQL instances in serverless mode is in preview. To use this feature, submit a ticket to be added to the whitelist.

Auto

EncryptionType

string

No

The encryption type. Valid values:

  • NULL: disables encryption. This is the default value.

  • CloudDisk: Enables cloud disk encryption. If you select this option, you must also specify a value for EncryptionKey.

Note

After cloud disk encryption is enabled, it cannot be disabled.

CloudDisk

EncryptionKey

string

No

The ID of the encryption key.

Note

If EncryptionType is set to CloudDisk, you must specify the ID of an encryption key 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: enables vector engine optimization.

  • disabled (default): disables vector engine optimization.

Note
  • For mainstream analytics, data warehousing, and real-time data warehousing scenarios, we recommend that you disable vector engine optimization.

  • For AIGC and vector search scenarios, we recommend that you enable vector engine optimization.

enabled

MasterCU

integer

No

The resources for the coordinator node. Valid values:

  • 2 CU

  • 4 CU

  • 8 CU

  • 16 CU

  • 32 CU

Note

You are charged for coordinator node resources of 8 CUs or more.

8 CU

SrcDbInstanceName

string

No

The ID of the source instance to be cloned.

Note

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

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

BackupId

string

No

The ID of the backup set.

Note

You can call the DescribeDataBackups operation to query the backup set IDs for the source instance.

1111111111

EnableSSL

boolean

No

Specifies whether to enable SSL encryption. Valid values:

  • true: SSL encryption is enabled.

  • false (default): SSL encryption is disabled.

false

ProdType

string

No

The product type. Valid values:

  • standard: Standard Edition.

  • cost-effective: Cost-effective Edition.

Note

If this parameter is not specified, the default value is standard.

standard

DeployMode

string

No

The deployment mode. Valid values:

  • multiple: multi-AZ deployment.

  • single: single-AZ deployment.

Note
  • If this parameter is not specified, the default value is single.

  • Defaults to single (single-AZ deployment), which is the only mode currently supported.

single

StandbyZoneId

string

No

The ID of the standby zone.

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

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

  • The standby zone must be different from the primary zone.

cn-hangzhou-j

StandbyVSwitchId

string

No

The ID of the vSwitch in the standby zone.

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

  • The vSwitch must be in the standby zone specified in StandbyZoneId.

vsw-bp1cpq8mr64paltkb****

MasterAISpec

string

No

Use this parameter to configure the coordinator node as a MasterAI node.

Note
  • This parameter and MasterCU are mutually exclusive.

  • This feature is available only in some regions and zones.

  • MasterAI nodes are supported only for AnalyticDB for PostgreSQL V7.0 Basic Edition instances.

  • For a list of all possible values, see the coordinator node specification change page in the console.

ADB.AIMedium.2

AINodeSpecInfos

array<object>

No

The AI node specifications.

object

No

The AI node specifications.

AINodeNum

string

No

The number of AI nodes.

1

AINodeSpec

string

No

The specifications of the AI nodes.

ADB.AIMedium.2

CacheStorageSize

string

No

The cache size for a serverless instance, in GB.

800

DBInstanceClass parameter

AnalyticDB for PostgreSQL currently supports the following two instance types:

  • high-performance: The names of these instance types start with gpdb.group.segsdx. They provide superior I/O capabilities.

  • high-capacity: The names of these instance types start with gpdb.group.seghdx. They provide larger, more cost-effective storage.

Select an instance type based on your storage and compute requirements.

AnalyticDB for PostgreSQL also supports OSS-based external tables. You can use gzip to compress data in external storage. To further reduce storage costs, you can store data not required for real-time computing there.

The following table lists the specifications for high-performance instances:


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 lists the specifications for high-capacity instances:


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

This parameter is deprecated and is no longer returned.

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

3432

ConnectionString

string

This parameter is deprecated and is no longer returned.

You can call the DescribeDBInstanceAttribute operation to query the connection string 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.