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.
NoteIf 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
babelfishsuffix.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.
NoteYou 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
Go to the Instances page. In the top navigation bar, select a region. Then, find your instance and click its ID.
On the Basic Information page, in the Configuration Information section, click Change to Serverless.

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.
NoteFor more information about the configuration items and their settings, see Create a serverless ApsaraDB RDS for PostgreSQL instance.
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.
NoteDuring the conversion, the instance status changes to Upgrading/Downgrading. After the conversion is complete, the instance status changes to Running.
FAQ
Related API operations
API | Description |
When you change the billing method from pay-as-you-go to serverless:
|
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.
Log on to the Resource Access Management (RAM) console with your Alibaba Cloud account.
In the navigation pane on the left, choose .
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.
Click Create Role.
In the upper-right corner of the Create Role page, click Create Service Linked Role.

On the Create Service Linked Role page, select AliyunServiceRoleForRdsPgsqlOnEcs for Select Service and click Create Service Linked Role.
NoteThe cloud services available for Select Service are subject to the options displayed in the console.
Repeat the preceding steps to create the AliyunServiceRoleForRDSProxyOnEcs service-linked role.