You can modify the attributes of an elastic network interface (ENI) based on your business requirements. For a secondary ENI, you can change the name, description, and associated security groups. For the primary ENI, you can change only the name and description. To change the security groups associated with the primary ENI, you must change the security groups associated with the Elastic Compute Service (ECS) instance to which the ENI is bound.
Considerations
When you replace the security groups associated with an ENI, take note of the following items:
Security group rules in the security groups associated with an ECS instance apply to the primary ENI bound to the instance. If you want to replace the security groups associated with the primary ENI, you can replace the security groups associated with the ECS instance to which the primary ENI is bound. For more information, see the Add an ECS instance to or remove an ECS instance from security groups or replace the security groups of an ECS instance section of the "Associate security groups with an instance (primary ENI)" topic.
A secondary ENI must be associated with at least one security group. Each secondary ENI of an ECS instance can be associated with a limited number of security groups. For more information, see the Security group limits section of the "Limits" topic.
The secondary ENIs of an ECS instance and the security groups to which you want to add the secondary ENIs must use the same network type. If the secondary ENIs of the ECS instance and the security groups use the VPC network type, they must belong to the same VPC.
A secondary ENI can be added only to security groups that are of the same type (basic or advanced). For more information, see Basic security groups and advanced security groups.
Procedure
You can change the names and descriptions of the primary and secondary ENIs, and the security groups associated with the secondary ENIs in the ECS console or by calling an API operation.
Use the ECS console
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Click the ID of the ENI whose attributes you want to modify to go to the ENI details page.
ENI Name: Click the
icon and follow the on-screen instructions to specify a new ENI name.
Description: Click the
icon and follow the on-screen instructions to specify a new ENI description.
Change Security Groups: Click Change Security Groups. In the Change Security Groups dialog box, select new security groups to which you want to add the ENI or delete the security groups from which you want to remove the ENI. Retain at least one security group associated with the ENI.
Call API operations
You can call the ModifyNetworkInterfaceAttribute operation to change the name, description, and associated security groups of an ENI. For more information, see ModifyNetworkInterfaceAttribute.
You can call the DescribeNetworkInterfaceAttribute operation to query the attributes of the ENI specified by NetworkInterfaceId.