interface CfnVPCCidrBlockProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.CfnVPCCidrBlockProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnVPCCidrBlockProps |
![]() | software.amazon.awscdk.services.ec2.CfnVPCCidrBlockProps |
![]() | aws_cdk.aws_ec2.CfnVPCCidrBlockProps |
![]() | aws-cdk-lib » aws_ec2 » CfnVPCCidrBlockProps |
Properties for defining a CfnVPCCidrBlock
.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html
Example
import { KubectlV32Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
declare const vpc: ec2.Vpc;
function associateSubnetWithV6Cidr(vpc: ec2.Vpc, count: number, subnet: ec2.ISubnet) {
const cfnSubnet = subnet.node.defaultChild as ec2.CfnSubnet;
cfnSubnet.ipv6CidrBlock = Fn.select(count, Fn.cidr(Fn.select(0, vpc.vpcIpv6CidrBlocks), 256, (128 - 64).toString()));
cfnSubnet.assignIpv6AddressOnCreation = true;
}
// make an ipv6 cidr
const ipv6cidr = new ec2.CfnVPCCidrBlock(this, 'CIDR6', {
vpcId: vpc.vpcId,
amazonProvidedIpv6CidrBlock: true,
});
// connect the ipv6 cidr to all vpc subnets
let subnetcount = 0;
const subnets = vpc.publicSubnets.concat(vpc.privateSubnets);
for (let subnet of subnets) {
// Wait for the ipv6 cidr to complete
subnet.node.addDependency(ipv6cidr);
associateSubnetWithV6Cidr(vpc, subnetcount, subnet);
subnetcount = subnetcount + 1;
}
const cluster = new eks.Cluster(this, 'hello-eks', {
version: eks.KubernetesVersion.V1_32,
vpc: vpc,
ipFamily: eks.IpFamily.IP_V6,
vpcSubnets: [{ subnets: vpc.publicSubnets }],
kubectlLayer: new KubectlV32Layer(this, 'kubectl'),
});
Properties
Name | Type | Description |
---|---|---|
vpc | string | The ID of the VPC. |
amazon | boolean | IResolvable | Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. |
cidr | string | An IPv4 CIDR block to associate with the VPC. |
ipv4 | string | Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. |
ipv4 | number | The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. |
ipv6 | string | An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool in the request. |
ipv6 | string | The name of the location from which we advertise the IPV6 CIDR block. |
ipv6 | string | Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. |
ipv6 | number | The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. |
ipv6 | string | The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. |
vpcId
Type:
string
The ID of the VPC.
amazonProvidedIpv6CidrBlock?
Type:
boolean |
IResolvable
(optional)
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.
cidrBlock?
Type:
string
(optional)
An IPv4 CIDR block to associate with the VPC.
ipv4IpamPoolId?
Type:
string
(optional)
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 .
ipv4NetmaskLength?
Type:
number
(optional)
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 .
ipv6CidrBlock?
Type:
string
(optional)
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.
ipv6CidrBlockNetworkBorderGroup?
Type:
string
(optional)
The name of the location from which we advertise the IPV6 CIDR block.
ipv6IpamPoolId?
Type:
string
(optional)
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 .
ipv6NetmaskLength?
Type:
number
(optional)
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 .
ipv6Pool?
Type:
string
(optional)
The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.