- Newest
- Most votes
- Most comments
Creating a VPC requires and IPv4 CIDR block to be specified. See here: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-sizing-ipv4
IPv4 VPC CIDR blocks
When you create a VPC, you must specify an IPv4 CIDR block for the VPC. The allowed block size is between a /16 netmask (65,536 IP addresses) and /28 netmask (16 IP addresses). After you've created your VPC, you can associate additional IPv4 CIDR blocks with the VPC. For more information, see Add or remove a CIDR block from your VPC.
When you create a VPC, we recommend that you specify a CIDR block from the private IPv4 address ranges as specified in RFC 1918.
Once you have created the VPC, you can create IPv6 only subnets within it. Instances/interfaces within these subnets will not have IPv4 addresses assigned. See blog here: https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-ipv6-only-subnets-and-ec2-instances/
Hope this helps.
It appears that you are encountering an issue when trying to create an IPv6-only VPC using the AWS CLI. The error message suggests that the API is expecting either a 'cidrBlock' or 'ipv4IpamPoolId' parameter, which is not consistent with creating an IPv6-only VPC.
This does seem to be a potential bug or limitation in the current implementation of the CreateVpc API operation. Typically, for creating an IPv6-only VPC, you should not need to specify an IPv4 CIDR block.
As a workaround, you might try including a dummy IPv4 CIDR block in your command, even though you intend to create an IPv6-only VPC. For example:
aws ec2 create-vpc --cidr-block 10.0.0.0/16 --ipv6-ipam-pool-id <ipam-pool-id> --ipv6-netmask-length 56
After creating the VPC with this workaround, you may need to remove the IPv4 CIDR block association separately to achieve an IPv6-only VPC.
If this workaround doesn't resolve the issue, it would be advisable to contact AWS support to report this potential bug and get further assistance. They may be able to provide a more definitive solution or confirm if this is indeed a known issue with the API.
Sources
create-vpc — AWS CLI 2.27.3 Command Reference
Use CreateVpc with an AWS SDK or CLI - AWS SDK Code Examples
Relevant content
- asked 3 years ago
The answer provided by the "AWS Generative AI capabilities" did not work.
I tried creating a VPC as a dual stack and then modifying to a IPv6 only stack, but was unable to remove the IPv4 stack.