UnassignPrivateIpAddressesCommand

Unassigns the specified secondary private IP addresses or IPv4 Prefix Delegation prefixes from a network interface.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { EC2Client, UnassignPrivateIpAddressesCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, UnassignPrivateIpAddressesCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // UnassignPrivateIpAddressesRequest
  Ipv4Prefixes: [ // IpPrefixList
    "STRING_VALUE",
  ],
  NetworkInterfaceId: "STRING_VALUE", // required
  PrivateIpAddresses: [ // PrivateIpAddressStringList
    "STRING_VALUE",
  ],
};
const command = new UnassignPrivateIpAddressesCommand(input);
const response = await client.send(command);
// {};

Example Usage

 Loading code editorLoading code editor

UnassignPrivateIpAddressesCommand Input

Parameter
Type
Description
NetworkInterfaceId
Required
string | undefined

The ID of the network interface.

Ipv4Prefixes
string[] | undefined

The IPv4 prefixes to unassign from the network interface.

PrivateIpAddresses
string[] | undefined

The secondary private IP addresses to unassign from the network interface. You can specify this option multiple times to unassign more than one IP address.

UnassignPrivateIpAddressesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
EC2ServiceException
Base exception class for all service exceptions from EC2 service.