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.
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 ESSD or premium performance disk.
-
Minor engine version: 20231030 or later, without the
babelfishsuffix. -
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.
NoteYou 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
-
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.
-
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 parameters and configuration principles, see Create a serverless ApsaraDB RDS for PostgreSQL instance.
-
Read and select the Terms of Service, then click Pay Now. In the confirmation dialog box that appears, verify the settings and click OK.
NoteDuring the change, the instance status changes to Upgrading/Downgrading. After the change is complete, the instance status changes to Running.
FAQ
Related APIs
|
API |
Description |
|
When you change the billing method from pay-as-you-go to serverless:
|
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.
-
Log on to the RAM console with your Alibaba Cloud account.
-
In the navigation pane on the left, choose .
-
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.
-
Click Create Role.
-
On the Create Role page, click Create Service-linked Role in the upper-right corner.
-
On the Create Service-linked Role page, select AliyunServiceRoleForRdsPgsqlOnEcs from the Select Trusted Service drop-down list and click Create Service-linked Role.
NoteThe services available in the Select Trusted Service drop-down list depend on what is displayed in the console.
-
Repeat the preceding steps to create the AliyunServiceRoleForRDSProxyOnEcs service-linked role.
-