Class VpcV2
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.alpha.VpcV2Base
software.amazon.awscdk.services.ec2.alpha.VpcV2
- All Implemented Interfaces:
IResource,IVpcV2,IVpc,IVPCRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-24T13:34:49.839Z")
@Stability(Experimental)
public class VpcV2
extends VpcV2Base
(experimental) This class provides a foundation for creating and configuring a VPC with advanced features such as IPAM (IP Address Management) and IPv6 support.
For more information, see the
AWS CDK Documentation on VPCs}.
invalid @link
{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html
Example:
Stack stack = new Stack();
VpcV2 myVpc = VpcV2.Builder.create(this, "Vpc")
.primaryAddressBlock(IpAddresses.ipv4("10.1.0.0/16"))
.secondaryAddressBlocks(List.of(IpAddresses.amazonProvidedIpv6(SecondaryAddressProps.builder()
.cidrBlockName("AmazonProvided")
.build())))
.build();
EgressOnlyInternetGateway eigw = EgressOnlyInternetGateway.Builder.create(this, "EIGW")
.vpc(myVpc)
.build();
RouteTable routeTable = RouteTable.Builder.create(this, "RouteTable")
.vpc(myVpc)
.build();
routeTable.addRoute("EIGW", "::/0", Map.of("gateway", eigw));
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.alpha.IVpcV2
IVpcV2.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVpcV2(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedVpcV2(software.amazon.jsii.JsiiObjectRef objRef) VpcV2(software.constructs.Construct scope, String id, VpcV2Props props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IVpcV2fromVpcV2Attributes(software.constructs.Construct scope, String id, VpcV2Attributes attrs) (experimental) Create a VPC from existing attributes.(experimental) Indicates if instances launched in this VPC will have public DNS hostnames.(experimental) Indicates if DNS support is enabled for this VPC.software.constructs.IDependable(experimental) To define dependency on internet connectivity.(experimental) The provider of ipv4 addresses.(experimental) The primary IPv4 CIDR block associated with the VPC.(experimental) IPv4 CIDR provisioned using IPAM pool Required to check for overlapping CIDRs after provisioning is complete under IPAM.(experimental) The IPv6 CIDR blocks for the VPC.(experimental) Isolated Subnets that are part of this VPC.(experimental) Identifier of the owner for this VPC.(experimental) Public Subnets that are part of this VPC.(experimental) Public Subnets that are part of this VPC.(experimental) Region for this VPC.(experimental) The AWS CloudFormation resource representing the VPC.(experimental) reference to all secondary blocks attached.(experimental) For validation to define IPv6 subnets, set to true in case of Amazon Provided IPv6 cidr range if true, IPv6 addresses can be attached to the subnets.(experimental) Arn of this VPC.(experimental) CIDR range for this VPC.getVpcId()(experimental) Identifier for this VPC.(experimental) VpcName to be used for tagging its components.Methods inherited from class software.amazon.awscdk.services.ec2.alpha.VpcV2Base
addClientVpnEndpoint, addEgressOnlyInternetGateway, addEgressOnlyInternetGateway, addFlowLog, addFlowLog, addGatewayEndpoint, addInterfaceEndpoint, addInternetGateway, addInternetGateway, addNatGateway, addVpnConnection, createAcceptorVpcRole, createPeeringConnection, enableVpnGateway, enableVpnGatewayV2, getAvailabilityZones, getEgressOnlyInternetGatewayId, getIncompleteSubnetDefinition, getInternetGatewayId, getVpcRef, getVpnGatewayId, selectSubnetObjects, selectSubnetObjects, selectSubnets, selectSubnets, setIncompleteSubnetDefinitionMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
VpcV2
protected VpcV2(software.amazon.jsii.JsiiObjectRef objRef) -
VpcV2
protected VpcV2(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
VpcV2
@Stability(Experimental) public VpcV2(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable VpcV2Props props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
VpcV2
@Stability(Experimental) public VpcV2(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromVpcV2Attributes
@Stability(Experimental) @NotNull public static IVpcV2 fromVpcV2Attributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VpcV2Attributes attrs) (experimental) Create a VPC from existing attributes.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
getDnsHostnamesEnabled
(experimental) Indicates if instances launched in this VPC will have public DNS hostnames. -
getDnsSupportEnabled
(experimental) Indicates if DNS support is enabled for this VPC. -
getInternetConnectivityEstablished
@Stability(Experimental) @NotNull public software.constructs.IDependable getInternetConnectivityEstablished()(experimental) To define dependency on internet connectivity.- Specified by:
getInternetConnectivityEstablishedin interfaceIVpc- Specified by:
getInternetConnectivityEstablishedin classVpcV2Base
-
getIpAddresses
(experimental) The provider of ipv4 addresses. -
getIpv4CidrBlock
(experimental) The primary IPv4 CIDR block associated with the VPC.Needed in order to validate the vpc range of subnet current prop vpcCidrBlock refers to the token value For more information, see the
}.invalid @link
{@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-sizing-ipv4- Specified by:
getIpv4CidrBlockin interfaceIVpcV2- Specified by:
getIpv4CidrBlockin classVpcV2Base
-
getIpv6CidrBlocks
(experimental) The IPv6 CIDR blocks for the VPC.See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html#aws-resource-ec2-vpc-return-values
-
getIsolatedSubnets
(experimental) Isolated Subnets that are part of this VPC.- Specified by:
getIsolatedSubnetsin interfaceIVpc- Specified by:
getIsolatedSubnetsin classVpcV2Base
-
getOwnerAccountId
(experimental) Identifier of the owner for this VPC.- Specified by:
getOwnerAccountIdin interfaceIVpcV2- Specified by:
getOwnerAccountIdin classVpcV2Base
-
getPrivateSubnets
(experimental) Public Subnets that are part of this VPC.- Specified by:
getPrivateSubnetsin interfaceIVpc- Overrides:
getPrivateSubnetsin classVpcV2Base
-
getPublicSubnets
(experimental) Public Subnets that are part of this VPC.- Specified by:
getPublicSubnetsin interfaceIVpc- Overrides:
getPublicSubnetsin classVpcV2Base
-
getRegion
(experimental) Region for this VPC. -
getResource
(experimental) The AWS CloudFormation resource representing the VPC. -
getUseIpv6
(experimental) For validation to define IPv6 subnets, set to true in case of Amazon Provided IPv6 cidr range if true, IPv6 addresses can be attached to the subnets.Default: false
-
getVpcArn
(experimental) Arn of this VPC. -
getVpcCidrBlock
(experimental) CIDR range for this VPC.- Specified by:
getVpcCidrBlockin interfaceIVpc- Specified by:
getVpcCidrBlockin classVpcV2Base
-
getVpcId
(experimental) Identifier for this VPC. -
getIpv4IpamProvisionedCidrs
(experimental) IPv4 CIDR provisioned using IPAM pool Required to check for overlapping CIDRs after provisioning is complete under IPAM.- Specified by:
getIpv4IpamProvisionedCidrsin interfaceIVpcV2- Specified by:
getIpv4IpamProvisionedCidrsin classVpcV2Base
-
getSecondaryCidrBlock
(experimental) reference to all secondary blocks attached.- Specified by:
getSecondaryCidrBlockin interfaceIVpcV2- Specified by:
getSecondaryCidrBlockin classVpcV2Base
-
getVpcName
(experimental) VpcName to be used for tagging its components.- Specified by:
getVpcNamein interfaceIVpcV2- Specified by:
getVpcNamein classVpcV2Base
-