Elastic Container Instance supports IPv4 and IPv6 addresses. When you create a container group through the CreateContainerGroup API operation, you can assign an IPv6 address to enable IPv6 connectivity for the elastic container instance.
Prerequisites
Before you begin, make sure that you have:
A VPC with IPv6 CIDR blocks enabled. For more information, see Enable IPv6 for a VPC
A vSwitch with IPv6 CIDR blocks enabled. For more information, see Enable IPv6 for a vSwitch
(Conditional) If you create elastic container instances by specifying Elastic Compute Service (ECS) instance types, the specified instance types must support IPv6 addresses. For more information, see Overview of instance families
All elastic container instances created by specifying the number of vCPUs and memory size support IPv6 addresses. If you create elastic container instances by specifying vCPUs and memory, IPv6 is always supported.
Limitations
Only one IPv6 address can be assigned to each elastic container instance.
Assign an IPv6 address through the API
Call the CreateContainerGroup API operation and set the following parameters:
| Parameter | Type | Example | Description |
|---|---|---|---|
| Ipv6AddressCount | Integer | 1 | The number of IPv6 addresses to assign. Set this to 1. Only one IPv6 address can be assigned per elastic container instance. |
| Ipv6GatewayBandwidthEnable | Boolean | true | Specifies whether to enable Internet access over IPv6 for the elastic container instance. |
| Ipv6GatewayBandwidth | Integer | 100 | The maximum Internet bandwidth of the IPv6 address, in Mbit/s. Takes effect only when Ipv6GatewayBandwidthEnable is set to true. For valid values, see the bandwidth range table below. Default: the maximum value in the bandwidth range of the IPv6 gateway. |
Bandwidth ranges by billing method
The valid range for Ipv6GatewayBandwidth depends on the billing method of the Internet bandwidth for the IPv6 Gateway:
| Billing method | Bandwidth range |
|---|---|
| pay-by-bandwidth | 1 to 2,000 Mbit/s |
| pay-by-traffic | 1 to 1,000 Mbit/s |
If Ipv6GatewayBandwidth is not specified, the default value is the maximum value in the bandwidth range of the IPv6 gateway.
Verify the IPv6 address
After you create the elastic container instance, call the DescribeContainerGroups API operation to query the instance details. The assigned IPv6 address appears in the Ipv6Address field of the response.