After you create a PolarDB for PostgreSQL (Compatible with Oracle) cluster, ECS instances cannot connect to the cluster until you configure a security group. Instead of adding individual Elastic Compute Service (ECS) instance IP addresses to the cluster whitelist one by one, you can add an ECS security group to grant access to all instances in that group at once.
Security groups and IP whitelists work together. The cluster allows connections from all IP addresses on the whitelist and from all ECS instances in any added security group.
Prerequisites
Before you begin, ensure that you have:
A PolarDB for PostgreSQL (Compatible with Oracle) cluster
An ECS security group in the same network type as the cluster (for example, a virtual private cloud (VPC)-type security group for a VPC-deployed cluster)
For instructions on creating an ECS security group, see Create a security group.
Constraints
Network type must match: Add only security groups of the same network type as the cluster. For a VPC-deployed cluster, add only VPC-type security groups.
10-group limit: Each cluster supports up to 10 security groups.
IP extraction behavior: When you add a security group, PolarDB extracts the current IP addresses of all ECS instances in that group and adds them to the cluster's IP whitelist. The ECS security group's own inbound and outbound rules have no effect on cluster access.
Add a security group
Log on to the PolarDB console.
In the left-side navigation pane, click Clusters.
In the upper-left corner, select the region where the cluster is deployed.
Find the cluster and click its ID.
In the left-side navigation pane, choose Settings and Management > Cluster Whitelists.
On the Cluster Whitelists page, click Select Security Group. To modify an existing security group configuration, click Configure in the Actions column instead.

In the Select Security Group panel, select one or more security groups and click OK.

The ECS instances in the selected security groups can now connect to the cluster.
API reference
| Operation | Description |
|---|---|
| DescribeDBClusterAccessWhitelist | Queries the IP addresses allowed to access a PolarDB cluster |
| ModifyDBClusterAccessWhitelist | Modifies the IP addresses allowed to access a PolarDB cluster |