Menu
Amazon Elastic Compute Cloud
API Reference (API Version 2016-11-15)

AssignIpv6Addresses

Assigns one or more IPv6 addresses to the specified network interface. You can specify one or more specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from within the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies per instance type. For information, see IP Addresses Per Network Interface Per Instance Type in the Amazon Elastic Compute Cloud User Guide.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

Ipv6AddressCount

The number of IPv6 addresses to assign to the network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. You can't use this option if specifying specific IPv6 addresses.

Type: Integer

Required: No

Ipv6Addresses.N

One or more specific IPv6 addresses to be assigned to the network interface. You can't use this option if you're specifying a number of IPv6 addresses.

Type: Array of strings

Required: No

NetworkInterfaceId

The ID of the network interface.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.

assignedIpv6Addresses

The IPv6 addresses assigned to the network interface.

Type: Array of strings

networkInterfaceId

The ID of the network interface.

Type: String

requestId

The ID of the request.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

Examples

Example 1

This example assigns two IPv6 addresses (2001:db8:1234:1a00::123 and 2001:db8:1234:1a00::456) to the specified network interface.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=AssignIpv6Addresses &NetworkInterfaceId=eni-d83388b1 &Ipv6Addresses.1=2001:db8:1234:1a00::123 &Ipv6Addresses.2=2001:db8:1234:1a00::456 &AUTHPARAMS

Sample Response

Copy
<AssignIpv6AddressesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>c36d17eb-a0ba-4d38-8727-example</requestId> <networkInterfaceId>eni-d83388b1</networkInterfaceId> <assignedIpv6Addresses> <item>2001:db8:1234:1a00::123</item> <item>2001:db8:1234:1a00::456</item> </assignedIpv6Addresses> </AssignIpv6AddressesResponse>

Example 2

This example assigns two IPv6 addresses to the specified network interface. Amazon EC2 automatically assigns the addresses from the available IPv6 addresses within the subnet's IPv6 CIDR block range.

Sample Request

Copy
https://ec2.amazonaws.com/?Action=AssignIpv6Addresses &NetworkInterfaceId=eni-d83388b1 &Ipv6AddressCount=2 &AUTHPARAMS

Sample Response

Copy
<AssignIpv6AddressesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>c36d17eb-a0ba-4d38-8727-example</requestId> <networkInterfaceId>eni-d83388b1</networkInterfaceId> <assignedIpv6Addresses> <item>2001:db8:1234:1a00:3304:8879:34cf:4071</item> <item>2002:db8:1234:1a00:9691:9503:25ad:1761</item> </assignedIpv6Addresses> </AssignIpv6AddressesResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: