AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::VPCCidrBlock

CfnVPCCidrBlock

Associates a CIDR block with your VPC. A VPC must have an associated IPv4 CIDR block. You can optionally associate additional IPv4 CIDR blocks with a VPC. You can optionally associate an IPv6 CIDR block with a VPC. You can request an Amazon-provided IPv6 CIDR block from Amazon's pool of IPv6 addresses, or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP addresses (BYOIP). For more information, see [VPC CIDR blocks](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html) in the *Amazon VPC User Guide* .

Import

import { CfnVPCCidrBlock } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnVPCCidrBlock

Properties

Configuration passed to the constructor as CfnVPCCidrBlockProps.

vpcIdRequired
string | IVPCRef

The ID of the VPC.

amazonProvidedIpv6CidrBlockOptional
boolean | IResolvable

Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR block.

cidrBlockOptional
string

An IPv4 CIDR block to associate with the VPC.

ipv4IpamPoolIdOptional
string

Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide* .

ipv4NetmaskLengthOptional
number

The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide* .

ipv6CidrBlockOptional
string

An IPv6 CIDR block from the IPv6 address pool. You must also specify `Ipv6Pool` in the request. To let Amazon choose the IPv6 CIDR block for you, omit this parameter.

ipv6CidrBlockNetworkBorderGroupOptional
string

The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location. You must set `AmazonProvidedIpv6CidrBlock` to `true` to use this parameter. You can have one IPv6 CIDR block association per network border group.

ipv6IpamPoolIdOptional
string

Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide* .

ipv6NetmaskLengthOptional
number

The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide* .

ipv6PoolOptional
string

The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic