Updated on 2026-06-12 GMT+08:00

Changing the Security Group of an ECS

Scenarios

When creating an ECS, you must associate it with a security group. If no security group has been created yet, a default security group will be created and associated with the ECS. If the default security group cannot meet your service requirements, you can change the security group associated with the ECS.

You can also associate an ECS with a custom security group. If the custom security group cannot meet your requirements, you can change the custom security group.

Changing the Security Group of an Individual ECS

  1. Log in to the ECS console and access the ECS list page.
  2. In the ECS list, choose More > Manage Network > Change Security Group in the Operation column.

    The Change Security Group panel slides out.

  3. Select the network interface whose security groups are to be changed and select new security groups as needed.
    Table 1 Parameters for changing security groups

    Parameter

    Description

    Network Interface

    This parameter is mandatory.

    The network interfaces attached to the ECS are displayed in the drop-down list. Select the target network interface whose security groups are to be changed.

    Security Group

    This parameter is mandatory.

    All security groups that can be associated are displayed in the drop-down list. If there are no available security groups, click Create Security Group.

    You can select multiple security groups at a time. They are sorted in the order in which they are selected. Traffic is matched based on the priority of security groups in descending order. A security group with a smaller sequence number has a higher priority. For details about traffic matching rules, see How Traffic Matches Security Group Rules.

    NOTE:

    Using multiple security groups may deteriorate ECS network performance. You are advised to select no more than five security groups.

    Security Group Rules

    The rules of the selected security groups are displayed here. You can expand to view the selected security groups and their rules or hide them.

    • Selected security groups: The selected security groups are displayed here. If you selected multiple security groups, you can click Up or Down in the Operation column to adjust their sequence.
    • Security group rules: The inbound and outbound rules of the selected security groups are displayed here.
  4. Click OK to complete the security group change.

    After the security groups are changed, you can return to the ECS list, click the target ECS to go to the ECS details page, and click the Security Groups tab to view all the associated security groups and rules.

    Figure 1 Viewing security groups