Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AssociateSubnetCidrBlock - Amazon Elastic Compute Cloud

AssociateSubnetCidrBlock

Associates a CIDR block with your subnet. You can only associate a single IPv6 CIDR block with your subnet.

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.

Ipv6CidrBlock

The IPv6 CIDR block for your subnet.

Type: String

Required: No

Ipv6IpamPoolId

An IPv6 IPAM pool ID.

Type: String

Required: No

Ipv6NetmaskLength

An IPv6 netmask length.

Type: Integer

Required: No

SubnetId

The ID of your subnet.

Type: String

Required: Yes

Response Elements

The following elements are returned by the service.

ipv6CidrBlockAssociation

Information about the IPv6 association.

Type: SubnetIpv6CidrBlockAssociation object

requestId

The ID of the request.

Type: String

subnetId

The ID of the subnet.

Type: String

Errors

For information about the errors that are common to all actions, see Common client error codes.

Examples

Example

This example associates IPv6 CIDR block 2001:db8:1234:1a00::/64 with subnet subnet-1a2b3c4d.

Sample Request

https://ec2.amazonaws.com/?Action=AssociateSubnetCidrBlock &SubnetId=subnet-1a2b3c4d &Ipv6CidrBlock=2001:db8:1234:1a00::/64 &AUTHPARAMS

Sample Response

<AssociateSubnetCidrBlock xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <subnetId>vpc-1a2b3c4d</subnetId> <ipv6CidrBlockAssociation> <ipv6CidrBlock>2001:db8:1234:1a00::/64</ipv6CidrBlock> <ipv6CidrBlockState> <state>associating</state> </ipv6CidrBlockState> <associationId>subnet-cidr-assoc-3aa54053</associationId> </ipv6CidrBlockAssociation> </AssociateSubnetCidrBlock>

See Also

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

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.