Serverless ApsaraDB RDS for PostgreSQL automatically scales CPU and memory in real time based on workload. You pay only for the RDS Capacity Units (RCUs) and storage you consume. This guide walks you through creating a serverless instance from the console.
Prerequisites
Before you begin, ensure that you have:
An Alibaba Cloud account, or a Resource Access Management (RAM) user with the AliyunRDSFullAccess permission. To grant permissions to a RAM user, see Authorize a RAM user.
Billing
A serverless instance incurs charges for two components:
RCUs: Billed based on the actual RCUs consumed.
Storage: Billed based on provisioned capacity. If usage exceeds the provisioned capacity, the instance scales out automatically and you are charged for the actual usage.
Automatic storage expansion is enabled by default and cannot be disabled. Once storage is expanded, it does not scale back in automatically—this protects data integrity. Monitor your storage usage and manually reduce storage capacity when needed. For details, see Reduce the storage capacity of an ApsaraDB RDS for PostgreSQL instance that uses cloud disks.
For a full pricing breakdown, see Serverless billing.
Key configuration decisions
Review these parameters before you start. Getting them right up front avoids post-creation changes.
Engine version: PostgreSQL 14 or later is supported. PostgreSQL 18 is not supported.
Edition: Choose based on your availability requirements.
| Edition | Use when |
|---|---|
| Basic Edition | Development, testing, or workloads that can tolerate brief downtime |
| High-availability Edition | Production workloads requiring cross-zone disaster recovery |
RCU range: 1 RCU = 1 vCPU + 2 GB of memory. The instance scales between your configured minimum and maximum automatically.
Setting the minimum to 0.5 RCU and enabling Automatic Start and Stop lets the instance pause after 10 minutes of inactivity and resume automatically when a connection arrives. This configuration is recommended for development environments.
The maximum number of connections is fixed at 2,400 and does not change with the RCU count.
Storage type: Only Premium ESSD and ESSD PL1 are supported.
Network: The instance must be in the same virtual private cloud (VPC) as any Elastic Compute Service (ECS) instance that connects to it over an internal network.
Create an instance
Go to the ApsaraDB RDS buy page.
Set Billing Method to Serverless.
Select a Region.
Place the instance in the same region as your ECS instance to avoid internet-only connectivity. You cannot change the region after creation. If you are connecting from a local server or computer (not ECS), select the region geographically closest to you and use the public endpoint.
Set Engine to PostgreSQL. Supported versions: PostgreSQL 14 or later (PostgreSQL 18 is not supported).
Select an Edition: Basic Edition or High-availability Edition.
Select a Storage Type: Premium ESSD or ESSD PL1.
Configure the serverless parameters.
You can change all of these settings after the instance is created. See Change the scaling range of RCUs, Change the scaling policy, and Configure the automatic start and stop feature.
Parameter Description RDS Capacity Units (RCUs) Set the Minimum and Maximum RCU values. The instance scales within this range automatically. Valid range: 0.5–32 RCU. Setting the minimum to 0.5 RCU enables the auto pause feature when Automatic Start and Stop is also enabled. Scaling Policy RCU scaling usually takes effect immediately and does not affect your services. In rare cases, a transient disconnection may occur. Select Do Not Execute Forcefully (default) to skip scaling when a disconnection would occur, or Execute Forcefully to scale immediately even if a transient disconnection results. Automatic Start and Stop When enabled, the instance pauses after 10 minutes with no connections and resumes automatically when a connection is established. Recommended for non-production environments. Select a Zone for the primary node. Zones within the same region perform similarly. If the target zone is sold out, select another zone.
(High-availability Edition only) Select a Deployment Method and a Zone of Secondary Node. Select Multi-zone Deployment to place the primary and secondary nodes in different zones for cross-zone disaster recovery.
Drag the slider to set Storage Capacity. This is the minimum amount billed. For example, if you select 100 GB, you are charged for 100 GB even if you use less.
Click Next: Instance Configuration.
Select a VPC and a vSwitch of Primary Node. Select the same VPC as your ECS instance to enable internal network connectivity. ECS instances in the same VPC but different vSwitches can still connect over the internal network.
(High-availability Edition only) Also select a vSwitch of Secondary Node.
For Add to Whitelist, select whether to add the VPC's CIDR block to the instance's IP whitelist. Selecting Yes allows all ECS instances in the VPC to access the RDS instance.
(Optional) Configure additional parameters. Default values work for most deployments.
Parameter Description Parameter Template Apply a pre-created parameter template. If none is specified, the system uses the default template. See Use a parameter template. Release Protection Prevents accidental instance deletion. See Enable or disable release protection. Resource Group Assign the instance to a resource group for easier management. Time Zone Named time zones only (UTC time zones are not supported). The system selects a default based on region if left blank. See Named time zones and region-to-time-zone mappings. SLR Authorization Required the first time you create an ApsaraDB RDS for PostgreSQL instance after October 10, 2022. Authorizes the service-linked roles (SLRs) AliyunServiceRoleForRdsPgsqlOnEcs and AliyunServiceRoleForRDSProxyOnEcs so that ApsaraDB RDS can attach elastic network interfaces (ENIs) and establish network links. This is a one-time authorization that does not incur fees. See Service-linked roles. Instance Description A custom label for the instance. 2–255 characters, starting with a letter or Chinese character. Accepts digits, underscores ( _), and hyphens (-).Privileged Account Select Configure Now to create a privileged database account during instance creation, or Configure Later to do it afterward. See Create an account. Click Next: Confirm Order.
Review the Parameter Configuration and Quantity, accept the Terms of Service, and click Pay Now.
Go to the Instances page. Select the instance's region from the navigation bar and locate the instance by Creation Time.
If the instance fails to create, the zone may have insufficient resources. Try a different zone. You can view any refund on the Orders page.
What's next
FAQ
Why can't I see the instance I just created in the instance list?
| Possible cause | Solution |
|---|---|
| Incorrect region | Switch to the correct region in the upper-left corner of the console. |
| Insufficient zone resources | The instance failed to create. Select a different zone and retry. Check the Orders page for a refund. |
API reference
To create a serverless ApsaraDB RDS for PostgreSQL instance using the API, call CreateDBInstance. Use the following parameters.
| Parameter | Description | Example |
|---|---|---|
RegionId | The region ID. Call DescribeRegions to list available regions. | cn-hangzhou |
Engine | The database engine. | PostgreSQL |
EngineVersion | The engine version. PostgreSQL 14 or later only. | 14.0 |
DBInstanceClass | The instance type. Basic Edition: pg.n2.serverless.1c. High-availability Edition: pg.n2.serverless.2c. | pg.n2.serverless.1c |
DBInstanceStorage | The storage capacity in GB. Range: 20–32,000. | 20 |
DBInstanceNetType | The connection type. Fixed value: Intranet. | Intranet |
SecurityIPList | The IP whitelist. Comma-separated, no duplicates, up to 1,000 entries. | 10.10.XX.XX |
PayType | The billing method. Fixed value: Serverless. | Serverless |
ZoneId | The primary node's zone ID. | cn-hangzhou-i |
ZoneIdSlave1 | (High-availability Edition) The secondary node's zone ID. | cn-hangzhou-h |
InstanceNetworkType | The network type. Fixed value: VPC. | VPC |
VPCId | The VPC ID. | vpc-bp**** |
VSwitchId | The vSwitch ID. For High-availability Edition, provide two IDs separated by a comma. | vsw-bp**** |
DBInstanceStorageType | The storage type. Fixed value: cloud_essd. | cloud_essd |
Category | The edition. Basic Edition: serverless_basic. High-availability Edition: serverless_standard. | serverless_basic |
ServerlessConfig.MaxCapacity | The maximum RCU count. Valid values: 1–14. | 12 |
ServerlessConfig.MinCapacity | The minimum RCU count. Valid values: 0.5–14. | 0.5 |
ServerlessConfig.AutoPause | Whether to enable auto pause. true: enable. false (default): disable. | true |
ServerlessConfig.SwitchForce | Whether to force RCU scaling when a transient disconnection would occur. true: force. false (default): do not force. | true |