All Products
Search
Document Center

ApsaraDB RDS:Create a serverless ApsaraDB RDS for PostgreSQL instance

Last Updated:Sep 25, 2023

This topic describes how to create a serverless ApsaraDB RDS PostgreSQL instance.

Prerequisites

The AliyunRDSFullAccess policy is attached to the RAM user that you want to use to create an RDS instance. For more information, see RAM authorization.

Billing rules

The fee for a serverless RDS instance consists of the fees that are generated for RDS Capacity Units (RCUs) and storage resources. For more information, see Overview of serverless ApsaraDB RDS for PostgreSQL instances.

Procedure

  1. Go to the ApsaraDB RDS buy page.

  2. Set the Billing Method parameter to Serverless.

  3. Configure the Region parameter.

    You need to select the region in which you want to create the RDS instance.

    Note
    • If your application or client is deployed on an Elastic Compute Service (ECS) instance, we recommend that you set this parameter to the region in which the ECS instance resides. If the RDS instance and the ECS instance reside in different regions, they cannot use an internal network to communicate with each other. This affects the performance of your application. You cannot change the region after the RDS instance is created.

    • If your application or client is deployed on an on-premises server or computer, we recommend that you select a region that is in close proximity to the on-premises server or computer. This way, you can use the public endpoint of the RDS instance to connect to the RDS instance from your application.

  4. Configure the Database Engine, Edition, RDS Capacity Units (RCUs), and Storage Type parameters.

    Parameter

    Description

    Example

    Database Engine

    Set the Database Engine parameter to PostgreSQL. 14 is supported.

    PostgreSQL 14

    Edition

    Set the parameter to Basic or RDS High-availability Edition.

    Basic

    RDS Capacity Units (RCUs)

    The performance of an RCU is equivalent to the performance of an RDS instance that has 1 CPU core and 2 GB of memory. The minimum value of Minimum is 0.5. The maximum value of Maximum is 14. After you configure the Minimum and Maximum parameters, the serverless RDS instance automatically scales the RCUs within the range of the values based on the actual workload.

    • Minimum: 0.5

    • Maximum: 14

  5. Optional. Configure parameters in the Advanced Settings section.

    Note

    You can modify the values of the Scaling Policy and Automatic Stop and Restart parameters after the serverless RDS instance is created. For more information, see Configure the automatic start and stop feature for a serverless ApsaraDB RDS for PostgreSQL instance and Change the scaling policy of a serverless ApsaraDB RDS for PostgreSQL instance.

    Parameter

    Description

    Example

    Scaling Policy

    The scaling policy for a serverless RDS instance. In most cases, the RCU scaling for the serverless RDS instance immediately takes effect and does not affect your workloads. In some special cases, transient connections may occur on the serverless RDS instance. You can specify whether to forcefully scale the RCUs when transient connections occur.

    Note

    Transient connections are countermeasures for emergency cases. The probability of transient connections is extremely low.

    Do Not Execute Forcefully

    Automatic Stop and Restart

    Specifies whether to enable the automatic start and stop feature for a serverless RDS instance. After the feature is enabled, if no connections are established to the RDS instance within 10 minutes, the instance is suspended.

    After a connection is established to the RDS instance, the instance automatically resumes.

    Disabled

  1. Configure the Storage Type parameter. Serverless RDS instances support only the ESSD PL1.

  2. Configure the Zone of Primary Node parameter.

    Select a zone

    • All zones in a region provide the same services.

    • If the RDS instance resides in the same region as the ECS instance that you want to connect, these instances can deliver optimal performance. If the RDS instance and the ECS instance reside in different zones in the same region, the performance of these instances slightly decreases.

      Note

      If Sold Out appears in the name of the zone that you selected, try another zone.

  1. Configure the Deployment Method parameter.

    If your set the Edition parameter to RDS High-availability Edition, you must configure the Deployment Method and Zone of Secondary Node parameters. We recommend that you set the Deployment Method parameter to Multi-zone Deployment. In this deployment method, the primary RDS instance and the secondary RDS instance reside in different zones of a region to provide cross-zone disaster recovery.

  1. Configure the Capacity parameter.

    You can drag the slider to change the storage capacity. You are charged for the total storage capacity of your serverless RDS instance. For example, if you select 100 GB of storage capacity when you create a serverless RDS instance, you are charged based on 100 GB even if you use less than 100 GB of storage. If the storage usage exceeds 100 GB, the system automatically scales up the storage capacity of the serverless RDS instance, and you are charged based on the actual usage.

    Important

    To ensure data integrity, Alibaba Cloud does not automatically scale in storage capacity when your storage requirements are reduced. You can manually release storage capacity after evaluating its effect to reduce operating costs.

  1. Click Next: Instance Configuration.

  1. Configure the VPC and VSwitch of Primary Node parameters.

    If you want to connect an RDS instance to your ECS instance over an internal network, select the same VPC as the ECS instance for the RDS instance. If the RDS instance and the ECS instance reside in different VPCs, you cannot connect these instances over an internal network.

    Note
    • You can connect the RDS instance and the ECS instance over an internal network even if the instances use different vSwitches in the same VPC.

    • If you select RDS High-availability Edition, you must also configure the VSwitch of Secondary Node.

  1. Configure the Add to Whitelist parameter to specify whether to add the CIDR block of the selected VPC to an IP address whitelist of the RDS instance. If you set this parameter to Yes, the ECS instances that reside in the selected VPC can access the RDS instance.

  1. Configure custom parameters. If you do not have special business requirements, you can retain the default values of these parameters.

    Parameter

    Description

    Parameter Template

    You can create a custom template before you create an RDS instance. When you create an RDS instance, you can select the created custom template. If you do not create a custom template, use the default parameter template. For more information, see Use a parameter template to configure the parameters of ApsaraDB RDS for PostgreSQL instances.

    Release Protection

    You can select Release Protection to prevent the RDS instance from being released due to unintended operations. For more information, see Enable or disable the release protection feature for an ApsaraDB RDS for PostgreSQL instance.

    Resource Group

    You can use the default resource group or select a custom resource group based on your business requirements to facilitate instance management.

    Time Zone

    You can specify a time zone for the RDS instance.

    • You must enter a time zone name for this parameter. Time zones represented in UTC offsets are not supported. For example, you can enter Asia/Shanghai. For more information about time zones, see Time zones.

    • If you do not configure this parameter, the system assigns the default time zone of the region that you specify for the RDS instance. For more information about the mappings between regions and default time zones, see Time zones.

    SLR Authorization

    If this is the first time you create an RDS instance after October 10, 2022, you must create the AliyunServiceRoleForRdsPgsqlOnEcs service-linked role (SLR) for ApsaraDB RDS for PostgreSQL. The role is used to establish network connections by binding elastic network interfaces (ENIs) to the server on which your RDS instance resides.

    Note

    Description

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

    Privileged Account

    You can select Now and configure the Database Account and Password parameters to create a privileged account when you create the RDS instance. You can also select Later to create a privileged account after the RDS instance is created.

    For more information about privileged accounts, see Create an account on an ApsaraDB RDS for PostgreSQL instance.

  1. Click Next: Confirm Order.

  1. Confirm the configuration in the Parameters section, configure the Purchase Plan parameter, read and select Terms of Service, and then click Pay Now to complete the payment.

  1. View the serverless RDS instance.

    Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance based on the Creation Time parameter.

What to do next

Create a database and an account on an ApsaraDB RDS for PostgreSQL instance

FAQ

After I submit an order to create an RDS instance, I cannot find the serverless RDS instance that is in the Creating state. Why?

Possible cause

Description

Suggestion

Incorrect region

The region that you selected is not the region in which the RDS instance resides.

In the top navigation bar, select the region in which the RDS instance resides.

Insufficient resources

The zone that you selected cannot provide sufficient resources.

You can go to the Orders page in the Billing Management console to view the refund.

Select another zone and try again.

References

  • For more information about how to change the scaling range of RCUs for a serverless RDS instance, see Change the scaling range of RCUs for a serverless ApsaraDB RDS for PostgreSQL instance.

  • For more information about how to configure the automatic start and stop feature for a serverless RDS instance, see Configure the automatic start and stop feature for a serverless ApsaraDB RDS for PostgreSQL instance.

  • For more information about how to change the scaling policy of a serverless RDS instance, see Change the scaling policy of RCUs for a serverless ApsaraDB RDS for PostgreSQL instance.

  • For more information about how to release a serverless RDS instance, see Release or unsubscribe from an ApsaraDB RDS for PostgreSQL instance.

  • For more information about how to create a serverless RDS instance by calling an operation, see Create an instance.

    Parameters required to create a serverless ApsaraDB RDS for PostgreSQL instance by calling an operation

    Parameter

    Description

    Example

    RegionId

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

    cn-hangzhou

    Engine

    The database engine of the serverless instance.

    PostgreSQL

    EngineVersion

    The database engine version of the serverless instance.

    Set the value to 14.0.

    14.0

    DBInstanceClass

    The instance type of the instance.

    • If you want to create a serverless instance that runs RDS Basic Edition, set the value to pg.n2.serverless.1c.

    • If you want to create a serverless instance that runs RDS High-availability Edition, set the value to pg.n2.serverless.2c.

    pg.n2.serverless.1c

    DBInstanceStorage

    The storage capacity of the instance.

    Valid values of this parameter range from 20 to 32000 because only the PL1 ESSD storage type is supported. Unit: GB.

    20

    DBInstanceNetType

    The network connection type of the instance. Set the value to Intranet, which indicates an internal network.

    Intranet

    SecurityIPList

    The IP address whitelist of the instance. For more information, see Use a database client or the CLI to connect to an ApsaraDB RDS for PostgreSQL instance. You can configure an IP address whitelist to allow access from specified IP addresses.

    If you want to add more than one entry to the IP address whitelist, separate the entries with commas (,). Each entry must be unique. You can add up to 1,000 entries.

    10.10.XX.XX

    PayType

    The billing method of the instance.

    Set the value to Serverless.

    Serverless

    ZoneId

    The ID of the zone in which the primary instance resides.

    cn-hangzhou-i

    ZoneIdSlave1

    If you want to create a serverless instance that runs RDS High-availability Edition, you must also specify the ID of zone in which the secondary serverless instance resides.

    cn-hangzhou-h

    InstanceNetworkType

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

    VPC

    VPCId

    The VPC ID of the instance.

    vpc-bp****

    VSwitchId

    The ID of the vSwitch. If you specify the ZoneSlaveId1 parameter, you must enter two the IDs of two vSwitches and separate them with a comma (,).

    vsw-bp****

    DBInstanceStorageType

    The storage type of the serverless instance.

    Set the value to cloud_essd.

    cloud_essd

    Category

    The RDS edition of the serverless instance.

    • If you want to create a serverless instance that runs RDS Basic Edition, set the value to serverless_basic.

    • If you want to create a serverless instance that runs RDS High-availability Edition, set the value to serverless_standard.

    serverless_basic

    ServerlessConfig

    The settings of the instance.

    MaxCapacity

    The maximum number of RCUs.

    Valid values: 1 to 14.

    12

    MinCapacity

    The minimum number of RCUs.

    Valid values: 0.5 to 14

    0.5

    AutoPause

    Specifies whether to enable the automatic start and stop feature.

    • true: enables the feature.

    • false: disables the feature. This is the default value.

    true

    SwitchForce

    Specifies whether to enable the forceful scaling feature for the serverless instance. Valid values:

    • true: enables the feature.

    • false: disables the feature. This is the default value.

    true