All Products
Search
Document Center

ApsaraDB RDS:Configure a security group for an ApsaraDB RDS for PostgreSQL instance

Last Updated:Feb 27, 2026

You can associate one or more Elastic Compute Service (ECS) security groups with an ApsaraDB RDS for PostgreSQL instance. All ECS instances in the associated security groups are automatically granted access to the RDS instance.

Background

By default, a newly created RDS instance does not allow external access. To enable access, configure at least one of the following:

You can use both methods simultaneously. When both are configured, access is granted to all IP addresses in the whitelists and all ECS instances in the associated security groups.

For more information about ECS security groups, see Create a security group.

Prerequisites

  • An ApsaraDB RDS for PostgreSQL instance is created.

  • An ECS security group exists with the same network type (VPC or classic network) as the RDS instance.

Limits

ItemLimit
Maximum security groups per RDS instance10
Network typeThe security group and the RDS instance must use the same network type. Both must be in a VPC, or both must use the classic network.

Note: If you change the network type of your RDS instance, all previously configured security groups become invalid. You must configure security groups that match the new network type.

Procedure

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, click Whitelist and SecGroup. On the page that appears, click the Security Group tab.
  3. Click Add Security Group.
    Note Security groups followed by a VPC tag contain ECS instances that reside in virtual private clouds (VPCs).
    Security Group
  4. Select the security group that you want to add, and then click OK.

What to do next

Create an account and a database

Related operations

Operation Description
DescribeSecurityGroupConfiguration Queries details about the ECS security groups that are associated with an instance.
ModifySecurityGroupConfiguration Modifies details about the ECS security groups that are associated with an instance.