A security group is a collection of access control rules for ECSs and RDS DB instances that have the same security protection requirements and are mutually trusted within a VPC.
Before you can connect to your DB instance, you need to create security group rules to enable specific IP addresses and ports to access your RDS instance.
This section describes how to configure an inbound rule for an RDS DB instance.
The default security group rule allows all outgoing data packets. ECSs and RDS instances can access each other if they are in the same security group. After a security group is created, you can configure security group rules to control access from and to the RDS instances in the security group.
in the upper left corner and select a region and a project.
in the upper left corner of the page and choose Database > Relational Database Service.To add more inbound rules, click +.
Parameter | Description | Example Value |
|---|---|---|
Priority | Security group rule priority. Value range: 1 to 100. The default value is 1 and indicates the highest priority. A rule with a smaller value has a higher priority. | 1 |
Action | Action of the security group rule. A rule with a deny action overrides another with an allow action if the two rules have the same priority. | Allow |
Protocol & Port | Protocol: network protocol. Available options include ANY, TCP, UDP, and ICMP. | TCP |
Port: the port over which the traffic can reach your DB instance. RDS for PostgreSQL instances can use database ports 2100 to 9500. | 5432 | |
Type | IP address type. | IPv4 |
Source | Source address. It can be a single IP address, an IP address group, or a security group to allow access from them to your DB instance. Example:
| 0.0.0.0/0 |
Description | Supplementary information about the security group rule. This parameter is optional. The description can contain a maximum of 255 characters and cannot contain angle brackets (<) or (>). | N/A |