Associate ECS security groups with your RDS PostgreSQL instance to grant all ECS instances in those groups access to the RDS instance.
Background
A newly created RDS instance blocks all external access. To allow connections, configure at least one of the following:
-
IP address whitelist: Grants access to specific IP addresses or CIDR blocks. Configure an IP address whitelist for an ApsaraDB RDS for PostgreSQL instance.
-
Security group: Grants access to all ECS instances in the associated ECS security group.
You can use both methods together. Access is then granted to all whitelisted IP addresses and all ECS instances in the associated security groups.
ECS security groups are described in 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
| Item | Limit |
|---|---|
| Maximum security groups per RDS instance | 10 |
| Network type | The security group and the RDS instance must use the same network type (VPC or classic network). |
Note: If you change the network type of your RDS instance, all previously configured security groups become invalid. Reconfigure security groups to match the new network type.
Procedure
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.
- In the left-side navigation pane, click Whitelist and SecGroup. On the page that appears, click the Security Group tab.
- Click Add Security Group.
Note Security groups followed by a VPC tag contain ECS instances that reside in virtual private clouds (VPCs).
- Select the security group that you want to add, and then click OK.
Next steps
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. |