Class CfnVPCCidrBlock
Associates a CIDR block with your VPC.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnVPCCidrBlock : CfnResource, IInspectable
Syntax (vb)
Public Class CfnVPCCidrBlock
Inherits CfnResource
Implements IInspectable
Remarks
You can optionally request an IPv6 CIDR block for the 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 in the Amazon VPC User Guide .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html
CloudformationResource: AWS::EC2::VPCCidrBlock
ExampleMetadata: infused
Examples
using Amazon.CDK.LambdaLayer.KubectlV32;
Vpc vpc;
public void AssociateSubnetWithV6Cidr(Vpc vpc, int count, ISubnet subnet)
{
var cfnSubnet = (CfnSubnet)subnet.Node.DefaultChild;
cfnSubnet.Ipv6CidrBlock = Fn.Select(count, Fn.Cidr(Fn.Select(0, vpc.VpcIpv6CidrBlocks), 256, (128 - 64).ToString()));
cfnSubnet.AssignIpv6AddressOnCreation = true;
}
// make an ipv6 cidr
var ipv6cidr = new CfnVPCCidrBlock(this, "CIDR6", new CfnVPCCidrBlockProps {
VpcId = vpc.VpcId,
AmazonProvidedIpv6CidrBlock = true
});
// connect the ipv6 cidr to all vpc subnets
var subnetcount = 0;
var subnets = vpc.PublicSubnets.Concat(vpc.PrivateSubnets);
for (var subnet in subnets)
{
// Wait for the ipv6 cidr to complete
subnet.Node.AddDependency(ipv6cidr);
AssociateSubnetWithV6Cidr(vpc, subnetcount, subnet);
subnetcount = subnetcount + 1;
}
var cluster = new Cluster(this, "hello-eks", new ClusterProps {
Version = KubernetesVersion.V1_32,
Vpc = vpc,
IpFamily = IpFamily.IP_V6,
VpcSubnets = new [] { new SubnetSelection { Subnets = vpc.PublicSubnets } },
KubectlLayer = new KubectlV32Layer(this, "kubectl")
});
Synopsis
Constructors
Cfn |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Cfn |
Used by jsii to construct an instance of this class from DeputyProps |
Cfn |
Properties
Amazon |
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. |
Attr |
The Id of the VPC associated CIDR Block. |
Attr |
The source that allocated the IP address space. |
Attr |
Public IPv6 addresses are those advertised on the internet from AWS . |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
Cfn |
|
Cidr |
An IPv4 CIDR block to associate with the VPC. |
Ipv4Ipam |
Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. |
Ipv4Netmask |
The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. |
Ipv6Cidr |
An IPv6 CIDR block from the IPv6 address pool. |
Ipv6Cidr |
The name of the location from which we advertise the IPV6 CIDR block. |
Ipv6Ipam |
Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. |
Ipv6Netmask |
The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. |
Ipv6Pool | The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. |
Vpc |
The ID of the VPC. |
Methods
Inspect(Tree |
Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnVPCCidrBlock(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnVPCCidrBlock(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
CfnVPCCidrBlock(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnVPCCidrBlock(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
CfnVPCCidrBlock(Construct, String, ICfnVPCCidrBlockProps)
public CfnVPCCidrBlock(Construct scope, string id, ICfnVPCCidrBlockProps props)
Parameters
- scope Constructs.
Construct Scope in which this resource is defined.
- id System.
String Construct identifier for this resource (unique in its scope).
- props ICfn
VPCCidr Block Props Resource properties.
Properties
AmazonProvidedIpv6CidrBlock
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC.
public virtual object AmazonProvidedIpv6CidrBlock { get; set; }
Property Value
System.
AttrId
The Id of the VPC associated CIDR Block.
public virtual string AttrId { get; }
Property Value
System.
Remarks
CloudformationAttribute: Id
AttrIpSource
The source that allocated the IP address space.
public virtual string AttrIpSource { get; }
Property Value
System.
Remarks
byoip
or amazon
indicates public IP address space allocated by Amazon or space that you have allocated with Bring your own IP (BYOIP). none
indicates private space.
CloudformationAttribute: IpSource
AttrIpv6AddressAttribute
Public IPv6 addresses are those advertised on the internet from AWS .
public virtual string AttrIpv6AddressAttribute { get; }
Property Value
System.
Remarks
Private IP addresses are not and cannot be advertised on the internet from AWS .
CloudformationAttribute: Ipv6AddressAttribute
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.
Overrides
CidrBlock
An IPv4 CIDR block to associate with the VPC.
public virtual string CidrBlock { get; set; }
Property Value
System.
Ipv4IpamPoolId
Associate a CIDR allocated from an IPv4 IPAM pool to a VPC.
public virtual string Ipv4IpamPoolId { get; set; }
Property Value
System.
Ipv4NetmaskLength
The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.
public virtual Nullable<double> Ipv4NetmaskLength { get; set; }
Property Value
System.
Ipv6CidrBlock
An IPv6 CIDR block from the IPv6 address pool.
public virtual string Ipv6CidrBlock { get; set; }
Property Value
System.
Remarks
You must also specify Ipv6Pool
in the request.
Ipv6CidrBlockNetworkBorderGroup
The name of the location from which we advertise the IPV6 CIDR block.
public virtual string Ipv6CidrBlockNetworkBorderGroup { get; set; }
Property Value
System.
Ipv6IpamPoolId
Associates a CIDR allocated from an IPv6 IPAM pool to a VPC.
public virtual string Ipv6IpamPoolId { get; set; }
Property Value
System.
Ipv6NetmaskLength
The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.
public virtual Nullable<double> Ipv6NetmaskLength { get; set; }
Property Value
System.
Ipv6Pool
The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.
public virtual string Ipv6Pool { get; set; }
Property Value
System.
VpcId
The ID of the VPC.
public virtual string VpcId { get; set; }
Property Value
System.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector Tree
Inspector tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.
Collections. <System.Generic. IDictionary String , System.Object >
Returns
System.