Class CfnVPCCidrBlock
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.ec2.CfnVPCCidrBlock
- All Implemented Interfaces:
IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-11T15:55:56.811Z")
@Stability(Stable)
public class CfnVPCCidrBlock
extends CfnResource
implements IInspectable
Associates a CIDR block with your VPC.
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 .
Example:
Vpc vpc; public void associateSubnetWithV6Cidr(Vpc vpc, Number count, ISubnet subnet) { CfnSubnet cfnSubnet = (CfnSubnet)subnet.getNode().getDefaultChild(); cfnSubnet.getIpv6CidrBlock() = Fn.select(count, Fn.cidr(Fn.select(0, vpc.getVpcIpv6CidrBlocks()), 256, (128 - 64).toString())); cfnSubnet.getAssignIpv6AddressOnCreation() = true; } // make an ipv6 cidr CfnVPCCidrBlock ipv6cidr = CfnVPCCidrBlock.Builder.create(this, "CIDR6") .vpcId(vpc.getVpcId()) .amazonProvidedIpv6CidrBlock(true) .build(); // connect the ipv6 cidr to all vpc subnets Number subnetcount = 0; ISubnet[] subnets = vpc.publicSubnets.concat(vpc.getPrivateSubnets()); for (Object subnet : subnets) { // Wait for the ipv6 cidr to complete subnet.node.addDependency(ipv6cidr); associateSubnetWithV6Cidr(vpc, subnetcount, subnet); subnetcount = subnetcount + 1; } Cluster cluster = Cluster.Builder.create(this, "hello-eks") .version(KubernetesVersion.V1_31) .vpc(vpc) .ipFamily(IpFamily.IP_V6) .vpcSubnets(List.of(SubnetSelection.builder().subnets(vpc.getPublicSubnets()).build())) .build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnVPCCidrBlock
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnVPCCidrBlock
(software.amazon.jsii.JsiiObjectRef objRef) CfnVPCCidrBlock
(software.constructs.Construct scope, String id, CfnVPCCidrBlockProps props) -
Method Summary
Modifier and TypeMethodDescriptionRequests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC.The Id of the VPC associated CIDR Block.The source that allocated the IP address space.Public IPv6 addresses are those advertised on the internet from AWS .An IPv4 CIDR block to associate with the VPC.Associate a CIDR allocated from an IPv4 IPAM pool to a VPC.The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.An IPv6 CIDR block from the IPv6 address pool.Associates a CIDR allocated from an IPv6 IPAM pool to a VPC.The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.getVpcId()
The ID of the VPC.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC.void
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC.void
setCidrBlock
(String value) An IPv4 CIDR block to associate with the VPC.void
setIpv4IpamPoolId
(String value) Associate a CIDR allocated from an IPv4 IPAM pool to a VPC.void
setIpv4NetmaskLength
(Number value) The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.void
setIpv6CidrBlock
(String value) An IPv6 CIDR block from the IPv6 address pool.void
setIpv6IpamPoolId
(String value) Associates a CIDR allocated from an IPv6 IPAM pool to a VPC.void
setIpv6NetmaskLength
(Number value) The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool.void
setIpv6Pool
(String value) The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.void
The ID of the VPC.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnVPCCidrBlock
protected CfnVPCCidrBlock(software.amazon.jsii.JsiiObjectRef objRef) -
CfnVPCCidrBlock
protected CfnVPCCidrBlock(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnVPCCidrBlock
@Stability(Stable) public CfnVPCCidrBlock(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnVPCCidrBlockProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrId
The Id of the VPC associated CIDR Block. -
getAttrIpSource
The source that allocated the IP address space.byoip
oramazon
indicates public IP address space allocated by Amazon or space that you have allocated with Bring your own IP (BYOIP).none
indicates private space. -
getAttrIpv6AddressAttribute
Public IPv6 addresses are those advertised on the internet from AWS .Private IP addresses are not and cannot be advertised on the internet from AWS .
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getVpcId
The ID of the VPC. -
setVpcId
The ID of the VPC. -
getAmazonProvidedIpv6CidrBlock
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. -
setAmazonProvidedIpv6CidrBlock
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. -
setAmazonProvidedIpv6CidrBlock
Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. -
getCidrBlock
An IPv4 CIDR block to associate with the VPC. -
setCidrBlock
An IPv4 CIDR block to associate with the VPC. -
getIpv4IpamPoolId
Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. -
setIpv4IpamPoolId
Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. -
getIpv4NetmaskLength
The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. -
setIpv4NetmaskLength
The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. -
getIpv6CidrBlock
An IPv6 CIDR block from the IPv6 address pool.You must also specify
Ipv6Pool
in the request. -
setIpv6CidrBlock
An IPv6 CIDR block from the IPv6 address pool.You must also specify
Ipv6Pool
in the request. -
getIpv6IpamPoolId
Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. -
setIpv6IpamPoolId
Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. -
getIpv6NetmaskLength
The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. -
setIpv6NetmaskLength
The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. -
getIpv6Pool
The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. -
setIpv6Pool
The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.
-