All Products
Search
Document Center

ApsaraDB RDS:Change the billing method from pay-as-you-go to serverless

Last Updated:Nov 28, 2025

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

Scenarios

Serverless instances are ideal if your workloads fluctuate significantly or if you want computing resources to scale automatically with your business workload. This model improves resource utilization and operations and maintenance (O&M) efficiency, which helps reduce costs.

For more information about the scenarios for serverless instances, see Overview of serverless ApsaraDB RDS for PostgreSQL instances.

Prerequisites

  • The instance must meet 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 ESSDs or premium performance disks.

    • Minor engine version: 20231030 or later, and the version number does not contain the babelfish suffix.

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

    • The database proxy feature is disabled.

    • The Secure Sockets Layer (SSL) encryption feature is disabled.

    • The disk encryption feature is disabled.

    • The connection pool (PgBouncer) feature is disabled.

    Note

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

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

Notes

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

  • The conversion fails if serverless instances are unavailable for purchase or if resources are insufficient in the zone where your instance resides.

  • Changing the billing method from pay-as-you-go to serverless causes a transient connection interruption. Make sure that your application is configured to automatically reconnect.

  • Set the maximum number of RDS Capacity Units (RCUs) to a value greater than or equal to the number of CPU cores of your current instance. For example, if your instance has 4 CPU cores, set the maximum number of RCUs to 4 or greater.

Costs

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 Instances page. In the top navigation bar, select a region. Then, find your instance and click its ID.

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

    image

  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 configuration items and their settings, see Create a serverless ApsaraDB RDS for PostgreSQL instance.

  4. Read and accept the Terms of Service, click Confirm Order, confirm the information in the dialog box that appears, and then click OK to complete the payment.

    Note

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

FAQ

Q: After I change the billing method from pay-as-you-go to serverless, why do I see a new purchase order on the Expenses And Costs > Orders > My Orders page?

A: The conversion process involves creating a new serverless instance and then switching your original instance to the new one. This process generates a new purchase order. After the switch is complete, the instance ID remains the same, and your instance is billed based on the serverless billing rules.

Q: After a successful payment, why does the instance status remain unchanged and the billing method conversion not start?

A: This issue usually occurs because the conversion fails due to insufficient resources in the zone where the instance resides. You can migrate the instance to another zone and then try to change the billing method to serverless again.

Related API operations

API

Description

ModifyDBInstanceSpec

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

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

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

    • For a Basic Edition serverless instance: pg.n2.serverless.1c

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

  • Leave other parameters, such as storage space, empty or keep their original values. You cannot modify them.

Appendix: View and create a service-linked role

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

  1. Log on to the Resource Access Management (RAM) console with your Alibaba Cloud account.

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

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

    If the roles are found, they have already been created. If not, perform the following steps to create the service-linked roles.

    1. Click Create Role.

    2. In the upper-right corner of the Create Role page, click Create Service Linked Role.

      image

    3. On the Create Service Linked Role page, select AliyunServiceRoleForRdsPgsqlOnEcs for Select Service and click Create Service Linked Role.

      image

      Note

      The cloud services available for Select Service are subject to the options displayed in the console.

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