Does Terraform support Secondary CIDR for VPCs?

Viewed 1053

I want to assign a secondary CIDR block to my VPC, but don't see how this is possible with terraform.

From the AWS docs: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html

Adding IPv4 CIDR Blocks to a VPC

You can associate secondary IPv4 CIDR blocks with your VPC. When you associate a CIDR block with your VPC, a route is automatically added to your VPC route tables to enable routing within the VPC (the destination is the CIDR block and the target is local).

Does anyone know if this is supported?

Thanks!

2 Answers

You can refer to the documentation around this here

When a VPC is created, a primary IPv4 CIDR block for the VPC must be specified. The aws_vpc_ipv4_cidr_block_association resource allows further IPv4 CIDR blocks to be added to the VPC

The aws_vpc resource has an assign_generated_ipv6_cidr_block parameter that is passable to it to allow for IPv6 CIDR ranges to be associated with the VPC which allows you to add an IPv6 range to your VPC but as of yet there's no support for adding an IPv4 range to the VPC.

You could raise a feature request for this on the AWS provider's Github project.

Related