When an elastic network interface (ENI) no longer needs secondary private IP addresses, you can unassign the IP addresses from the ENI.
Before you unassign secondary private IP addresses from an ENI, make sure that the following prerequisites are met:
One or more secondary private IP addresses are assigned to the ENI.
The ENI is in the Available (Available) or Bound (InUse) state.
When you unassign secondary private IP addresses from a primary ENI, the Elastic Compute Service (ECS) instance to which the primary ENI is attached is in the Running (Running) or Stopped (Stopped) state.
You can configure event notifications in EventBridge or CloudMonitor to specify how you receive notifications for the events that private IP addresses are unassigned. You can select by email and DingTalk chatbots. You can obtain information, such as the IDs of ENIs and the secondary private IP addresses that are unassigned from the ENIs, from the notifications and configure operations to be automatically performed in response to the notifications. For more information, see Configure event notifications, ECS events, and IP address event notifications.
Use the ECS console
Log on to the ECS console.
In the left-side navigation pane, choose .
In the upper-left corner of the top navigation bar, select a region.
On the Network Interfaces page, find the ENI from which you want to unassign secondary private IP addresses and click Manage Secondary Private IP Address in the Actions column.
In the Manage Secondary Private IP Address dialog box, find the secondary private IP addresses that you want to unassign in the IPv4 Addresses section and click Unassign on the right side of the IP addresses.
UnassignPrivateIpAddresses: unassigns secondary private IP addresses.