This topic describes how to configure a security group for an ApsaraDB RDS for MySQL instance. The RDS security group can be associated with an Elastic Compute Service (ECS) security group to allow all ECS instances in the ECS security group to access the RDS instance.
Prerequisites
Your RDS instance runs one of the following MySQL versions:
MySQL 8.0
MySQL 5.7
MySQL 5.6
Scenarios
After your RDS instance is created, you must configure IP address whitelists or security groups for the RDS instance for the specified devices to access the RDS instance. For more information about how to configure an IP address whitelist, see Configure an IP address whitelist for an ApsaraDB RDS for MySQL instance.
An ECS security group controls the inbound and outbound traffic of the ECS instances in the group. For more information, see Create a security group.
You can configure both IP address whitelists and security groups for your RDS instance. All the IP addresses in the configured IP address whitelists and all the ECS instances in the configured security groups are granted access to your RDS instance.
Usage notes
The security groups that you can add to your RDS instance must have the same network type as the instance. For example, if the network type of the instance is VPC, you can add only security groups whose network type is VPC to the instance.
After you change the network type of your RDS instance, the configured security groups become invalid. In this case, you must reconfigure the security groups with the new network type.
A maximum of 10 security groups are allowed per RDS instance.
Security groups cannot be added for RDS instances located in some regions. For these instances, you can configure IP address whitelists
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.
NoteSecurity 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.
What to do next
Related operations
Operation | Description |
Queries details about the ECS security groups that are associated with an instance. | |
Modifies details about the ECS security groups that are associated with an instance. |