This topic describes how to modify primary and secondary Elastic Network Interfaces (ENIs). You can change the security group of a primary ENI by moving its bound ECS instance to a different security group. You can modify the attributes of a secondary ENI such as the name, associated security group, and description.

Background information

Before you can modify the security group to which an ENI belongs, the ENI and its bound ECS instance must meet the following requirements. For more information, see Security group overview.
  • An ECS instance cannot belong to both basic and advanced security groups at the same time.
  • An ENI cannot belong to both basic and advanced security groups at the same time.
  • An ENI can only be bound to an ECS instance when they belong to the same type of security groups.

Modify a primary ENI

The primary ENI and the secondary ENIs of an ECS instance can belong to different security groups. If you move the ECS instance to a different security group, the primary ENI will also be associated with this security group, but the secondary ENIs will remain in the previous security group. Follow these steps to modify a primary ENI:

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Network & Security > Security Groups.
  3. In the top navigation bar, select a region.
  4. Find the target security group and click Manage Instances in the Actions column.
  5. On the Instances in Security Group page, change the security group that the primary ENI is associated with:
    • Follow these steps to add the primary ENI to a new security group:
      1. In the upper-right corner of the Instances in Security Group page, click Add Instance.
      2. In the Add Instance dialog box that appears, select the ID of the instance to which the primary ENI is bound. Click OK.

        The primary ENI is added to the new security group along with the corresponding ECS instance.

    • Follow these steps to remove the primary ENI from its current security group:
      1. On the Instances in Security Group page, select one or more instances and click Remove from Security Group.
      2. In the Remove ECS Instance from Security Group message that appears, click OK.

        The primary ENI is removed from the current security group along with the corresponding ECS instance. Note that the primary ENI and the ECS instance must belong to at least one security group.

  6. Go back to the homepage of the ECS console. In the left-side navigation pane, choose Network & Security > ENIs.
  7. Find the target primary ENI and verify whether the settings have taken effect.

Modify a secondary ENI

Follow these steps to modify the name, security group, or description of a secondary ENI: Make sure that you have created a secondary ENI before you proceed. For more information, see Create an ENI.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Network & Security > ENIs.
  3. In the top navigation bar, select a region.
  4. Find the target secondary ENI and click Modify in the Actions column.
  5. In the Modify dialog box that appears, modify the ENI attributes as follows:
    • ENI Name: Specify a new ENI name based on the naming conventions displayed under this field.
    • Security Group: Select a new security group for the ENI, or remove the ENI from a security group. Note that the ENI must be associated with at least one security group.
    • Description: Modify the description based on the instructions displayed under this field.
  6. Click OK.