All Products
Search
Document Center

ApsaraDB RDS:Change an instance from pay-as-you-go to serverless

Last Updated:Jun 20, 2026

This topic describes how to change the billing method of an ApsaraDB RDS for PostgreSQL instance from pay-as-you-go to serverless.

Use cases

If your business workloads fluctuate significantly, require a large storage capacity, or need compute resources that scale automatically, a serverless instance is recommended.

For more information about the use cases for serverless instances, see Introduction to serverless ApsaraDB RDS for PostgreSQL instances.

Prerequisites

  • The instance meets the following requirements:

    • Status: Running

    • Major engine version: PostgreSQL 14 or later.

    • Edition: Basic Edition or High-Availability Edition.

    • Billing method: pay-as-you-go.

      Note

      If the instance uses the subscription billing method, you must first change the billing method to pay-as-you-go before you can change it to serverless.

    • Storage type: PL1 ESSD or premium performance disk.

    • Minor engine version: 20231030 or later, without the babelfish suffix.

    • The instance is a primary instance and has no read-only instances.

    • The database proxy feature is disabled.

    • The SSL encryption feature is disabled.

    • The disk encryption feature is disabled.

    • The connection pool (PgBouncer) feature is disabled.

    Note

    You can view this information on the instance details page in the ApsaraDB RDS console.

  • The AliyunServiceRoleForRdsPgsqlOnEcs and AliyunServiceRoleForRDSProxyOnEcs service-linked roles are created for your Alibaba Cloud account.

Precautions

  • You can switch between the pay-as-you-go and serverless billing methods only once every 24 hours.

  • The change fails if serverless instances are sold out or resources are insufficient in the zone where the instance is located.

  • Changing the billing method from pay-as-you-go to serverless causes a transient connection interruption. Ensure your application is configured with an automatic reconnection mechanism.

  • We recommend setting the maximum number of RCUs to at least the number of vCores of the current instance.

Billing

Changing the billing method from pay-as-you-go to serverless is free of charge. For more information about the billing of serverless instances, see Serverless pricing.

Procedure

  1. Go to the RDS Instances page. In the top navigation bar, select the region where your instance is located. Then, click the ID of the instance.

  2. On the Basic Information page, in the Configuration Information section, click Change to Serverless.

  3. On the buy page, configure RDS Capacity Units (RCUs) and Switching Time. In the Advanced Settings section, configure Scaling Policy and Automatic Stop and Restart.

    Note

    For more information about the parameters and configuration principles, see Create a serverless ApsaraDB RDS for PostgreSQL instance.

  4. Read and select the Terms of Service, then click Pay Now. In the confirmation dialog box that appears, verify the settings and click OK.

    Note

    During the change, the instance status changes to Upgrading/Downgrading. After the change is complete, the instance status changes to Running.

FAQ

Q: After I change the billing method to serverless, why do I see a new purchase order on the Expenses and Costs > Order > My Orders page?

A: The change is implemented by creating a new serverless instance and then switching your original instance to the new one. This process generates a new purchase order.

Q: After the payment is complete, why does the instance status remain unchanged and the billing method is not switched?

A: This issue usually occurs because the change fails due to insufficient resources in the zone where your instance is located. You must migrate the instance to another zone and then try to change the billing method again.

Related APIs

API

Description

ModifyDBInstanceSpec

When you change the billing method from pay-as-you-go to serverless:

  • Make sure that the instance's original billing method is pay-as-you-go and set the PayType parameter to Serverless.

  • Set the DBInstanceClass parameter to one of the following values:

    • pg.n2.serverless.1c for a Basic Edition serverless instance

    • pg.n2.serverless.2c for a High-Availability Edition serverless instance

  • For other parameters, such as storage capacity, pass empty values or keep their original values. These parameters cannot be modified during the change.

Appendix: View and create service-linked roles

Before you change the billing method from pay-as-you-go to serverless, you must create the AliyunServiceRoleForRdsPgsqlOnEcs and AliyunServiceRoleForRDSProxyOnEcs service-linked roles for your Alibaba Cloud account.

  1. Log on to the RAM console with your Alibaba Cloud account.

  2. In the navigation pane on the left, choose Identities > Role.

  3. In the search box to the right of the Create Role button, search for the AliyunServiceRoleForRdsPgsqlOnEcs and AliyunServiceRoleForRDSProxyOnEcs service-linked roles.

    If the service-linked roles appear in the search results, they already exist. If not, follow the steps below to create them.

    1. Click Create Role.

    2. On the Create Role page, click Create Service-linked Role in the upper-right corner.

    3. On the Create Service-linked Role page, select AliyunServiceRoleForRdsPgsqlOnEcs from the Select Trusted Service drop-down list and click Create Service-linked Role.

      Note

      The services available in the Select Trusted Service drop-down list depend on what is displayed in the console.

    4. Repeat the preceding steps to create the AliyunServiceRoleForRDSProxyOnEcs service-linked role.