CfnVPCCidrBlockProps

class aws_cdk.aws_ec2.CfnVPCCidrBlockProps(*, vpc_id, amazon_provided_ipv6_cidr_block=None, cidr_block=None, ipv4_ipam_pool_id=None, ipv4_netmask_length=None, ipv6_cidr_block=None, ipv6_ipam_pool_id=None, ipv6_netmask_length=None, ipv6_pool=None)

Bases: object

Properties for defining a CfnVPCCidrBlock.

Parameters:
  • vpc_id (str) – The ID of the VPC.

  • amazon_provided_ipv6_cidr_block (Union[bool, IResolvable, None]) – 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.

  • cidr_block (Optional[str]) – An IPv4 CIDR block to associate with the VPC.

  • ipv4_ipam_pool_id (Optional[str]) – 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? in the Amazon VPC IPAM User Guide .

  • ipv4_netmask_length (Union[int, float, None]) –

    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? in the Amazon VPC IPAM User Guide .

  • ipv6_cidr_block (Optional[str]) – 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.

  • ipv6_ipam_pool_id (Optional[str]) –

    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? in the Amazon VPC IPAM User Guide .

  • ipv6_netmask_length (Union[int, float, None]) –

    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? in the Amazon VPC IPAM User Guide .

  • ipv6_pool (Optional[str]) – The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html

ExampleMetadata:

infused

Example:

# vpc: ec2.Vpc


def associate_subnet_with_v6_cidr(self, vpc, count, subnet):
    cfn_subnet = subnet.node.default_child
    cfn_subnet.ipv6_cidr_block = Fn.select(count, Fn.cidr(Fn.select(0, vpc.vpc_ipv6_cidr_blocks), 256, (128 - 64).to_string()))
    cfn_subnet.assign_ipv6_address_on_creation = True

# make an ipv6 cidr
ipv6cidr = ec2.CfnVPCCidrBlock(self, "CIDR6",
    vpc_id=vpc.vpc_id,
    amazon_provided_ipv6_cidr_block=True
)

# connect the ipv6 cidr to all vpc subnets
subnetcount = 0
subnets = vpc.public_subnets.concat(vpc.private_subnets)
for subnet in subnets:
    # Wait for the ipv6 cidr to complete
    subnet.node.add_dependency(ipv6cidr)
    associate_subnet_with_v6_cidr(vpc, subnetcount, subnet)
    subnetcount = subnetcount + 1

cluster = eks.Cluster(self, "hello-eks",
    version=eks.KubernetesVersion.V1_29,
    vpc=vpc,
    ip_family=eks.IpFamily.IP_V6,
    vpc_subnets=[ec2.SubnetSelection(subnets=vpc.public_subnets)]
)

Attributes

amazon_provided_ipv6_cidr_block

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-amazonprovidedipv6cidrblock

cidr_block

An IPv4 CIDR block to associate with the VPC.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-cidrblock

ipv4_ipam_pool_id

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? in the Amazon VPC IPAM User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-ipv4ipampoolid

ipv4_netmask_length

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? in the Amazon VPC IPAM User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-ipv4netmasklength

ipv6_cidr_block

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-ipv6cidrblock

ipv6_ipam_pool_id

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? in the Amazon VPC IPAM User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-ipv6ipampoolid

ipv6_netmask_length

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? in the Amazon VPC IPAM User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-ipv6netmasklength

ipv6_pool

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-ipv6pool

vpc_id

The ID of the VPC.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html#cfn-ec2-vpccidrblock-vpcid