Class CfnVPC
- All Implemented Interfaces:
IInspectable,IVPCRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
A VPC must have an associated IPv4 CIDR block. You can specify an IPv4 CIDR block or an IPAM-allocated IPv4 CIDR block. To associate an IPv6 CIDR block with the VPC, see AWS::EC2::VPCCidrBlock .
For more information, see Virtual private clouds (VPC) in the Amazon VPC User Guide .
Example:
CfnInclude cfnTemplate;
// using from*Attributes()
CfnSubnet privateCfnSubnet1;
CfnSubnet privateCfnSubnet2;
// using from*Name()
CfnBucket cfnBucket = (CfnBucket)cfnTemplate.getResource("Bucket");
IBucket bucket = Bucket.fromBucketName(this, "L2Bucket", cfnBucket.getRef());
// using from*Arn()
CfnKey cfnKey = (CfnKey)cfnTemplate.getResource("Key");
IKey key = Key.fromKeyArn(this, "L2Key", cfnKey.getAttrArn());
CfnVPC cfnVpc = (CfnVPC)cfnTemplate.getResource("Vpc");
IVpc vpc = Vpc.fromVpcAttributes(this, "L2Vpc", VpcAttributes.builder()
.vpcId(cfnVpc.getRef())
.availabilityZones(Fn.getAzs())
.privateSubnetIds(List.of(privateCfnSubnet1.getRef(), privateCfnSubnet2.getRef()))
.build());
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnVPC.static interfaceDescribes an exclusion configuration for VPC Encryption Control.static interfaceDescribes the exclusion configurations for various resource types in VPC Encryption Control.static interfaceDescribes the configuration and state of VPC encryption controls.Nested 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.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.ec2.IVPCRef
IVPCRef.Jsii$Default, IVPCRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnVPC(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnVPC(software.amazon.jsii.JsiiObjectRef objRef) Create a newAWS::EC2::VPC.CfnVPC(software.constructs.Construct scope, String id, CfnVPCProps props) Create a newAWS::EC2::VPC. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic IVPCRefCreates a new IVPCRef from a vpcId.The primary IPv4 CIDR block for the VPC.The association IDs of the IPv4 CIDR blocks for the VPC.The ID of the default network ACL for the VPC.The ID of the default security group for the VPC.The IPv6 CIDR blocks for the VPC.Describes the exclusion configurations for various resource types in VPC Encryption Control.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.Describes an exclusion configuration for VPC Encryption Control.The current state of the exclusion configuration.A message providing additional information about the exclusion state.The current state of the VPC Encryption Control configuration.A message providing additional information about the encryption control state.The ID of the VPC Encryption Control configuration.The ID of the VPC associated with the encryption control configuration.The ID of the VPC.The IPv4 network range for the VPC, in CIDR notation.Indicates whether the instances launched in the VPC get DNS hostnames.Indicates whether the DNS resolution is supported for the VPC.The allowed tenancy of instances launched into the VPC.The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool.getTags()Tag Manager which manages the tags for this resource.The tags for the VPC.Describes the configuration and state of VPC encryption controls.A reference to a VPC resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnVPC.renderProperties(Map<String, Object> props) voidsetCidrBlock(String value) The IPv4 network range for the VPC, in CIDR notation.voidsetEnableDnsHostnames(Boolean value) Indicates whether the instances launched in the VPC get DNS hostnames.voidsetEnableDnsHostnames(IResolvable value) Indicates whether the instances launched in the VPC get DNS hostnames.voidsetEnableDnsSupport(Boolean value) Indicates whether the DNS resolution is supported for the VPC.voidsetEnableDnsSupport(IResolvable value) Indicates whether the DNS resolution is supported for the VPC.voidsetInstanceTenancy(String value) The allowed tenancy of instances launched into the VPC.voidsetIpv4IpamPoolId(String value) The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.voidsetIpv4NetmaskLength(Number value) The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool.voidsetTagsRaw(List<CfnTag> value) The tags for the VPC.voidDescribes the configuration and state of VPC encryption controls.voidDescribes the configuration and state of VPC encryption controls.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, addResourceDependency, addResourceDependency, applyCrossStackReferenceStrength, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, cfnPropertyName, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, removeDependency, removeResourceDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId, withMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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
-
CfnVPC
protected CfnVPC(software.amazon.jsii.JsiiObjectRef objRef) -
CfnVPC
protected CfnVPC(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnVPC
@Stability(Stable) public CfnVPC(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnVPCProps props) Create a newAWS::EC2::VPC.- 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.
-
CfnVPC
Create a newAWS::EC2::VPC.- 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.
-
-
Method Details
-
arnForVPC
- Parameters:
resource- This parameter is required.
-
fromVpcId
@Stability(Stable) @NotNull public static IVPCRef fromVpcId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String vpcId) Creates a new IVPCRef from a vpcId.- Parameters:
scope- This parameter is required.id- This parameter is required.vpcId- This parameter is required.
-
isCfnVPC
Checks whether the given object is a CfnVPC.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrCidrBlock
The primary IPv4 CIDR block for the VPC.For example, 10.0.0.0/16.
-
getAttrCidrBlockAssociations
The association IDs of the IPv4 CIDR blocks for the VPC.For example, [ vpc-cidr-assoc-0280ab6b ].
-
getAttrDefaultNetworkAcl
The ID of the default network ACL for the VPC.For example, acl-814dafe3.
-
getAttrDefaultSecurityGroup
The ID of the default security group for the VPC.For example, sg-b178e0d3.
-
getAttrIpv6CidrBlocks
The IPv6 CIDR blocks for the VPC.For example, [ 2001:db8:1234:1a00::/56 ].
-
getAttrVpcEncryptionControlResourceExclusions
Describes the exclusion configurations for various resource types in VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsEgressOnlyInternetGateway
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsEgressOnlyInternetGateway()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsEgressOnlyInternetGatewayState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsEgressOnlyInternetGatewayState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsEgressOnlyInternetGatewayStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsEgressOnlyInternetGatewayStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsElasticFileSystem
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsElasticFileSystem()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsElasticFileSystemState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsElasticFileSystemState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsElasticFileSystemStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsElasticFileSystemStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsInternetGateway
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsInternetGateway()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsInternetGatewayState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsInternetGatewayState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsInternetGatewayStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsInternetGatewayStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsLambda
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsLambda()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsLambdaState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsLambdaState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsLambdaStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsLambdaStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsNatGateway
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsNatGateway()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsNatGatewayState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsNatGatewayState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsNatGatewayStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsNatGatewayStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsVirtualPrivateGateway
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsVirtualPrivateGateway()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsVirtualPrivateGatewayState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsVirtualPrivateGatewayState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsVirtualPrivateGatewayStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsVirtualPrivateGatewayStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsVpcLattice
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsVpcLattice()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsVpcLatticeState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsVpcLatticeState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsVpcLatticeStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsVpcLatticeStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlResourceExclusionsVpcPeering
@Stability(Stable) @NotNull public IResolvable getAttrVpcEncryptionControlResourceExclusionsVpcPeering()Describes an exclusion configuration for VPC Encryption Control.For more information, see Enforce VPC encryption in transit in the Amazon VPC User Guide.
-
getAttrVpcEncryptionControlResourceExclusionsVpcPeeringState
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsVpcPeeringState()The current state of the exclusion configuration. -
getAttrVpcEncryptionControlResourceExclusionsVpcPeeringStateMessage
@Stability(Stable) @NotNull public String getAttrVpcEncryptionControlResourceExclusionsVpcPeeringStateMessage()A message providing additional information about the exclusion state. -
getAttrVpcEncryptionControlState
The current state of the VPC Encryption Control configuration. -
getAttrVpcEncryptionControlStateMessage
A message providing additional information about the encryption control state. -
getAttrVpcEncryptionControlVpcEncryptionControlId
The ID of the VPC Encryption Control configuration. -
getAttrVpcEncryptionControlVpcId
The ID of the VPC associated with the encryption control configuration. -
getAttrVpcId
The ID of the VPC. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getCfnPropertyNames
- Overrides:
getCfnPropertyNamesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getVpcRef
A reference to a VPC resource. -
getCidrBlock
The IPv4 network range for the VPC, in CIDR notation. -
setCidrBlock
The IPv4 network range for the VPC, in CIDR notation. -
getEnableDnsHostnames
Indicates whether the instances launched in the VPC get DNS hostnames.Returns union: either
BooleanorIResolvable -
setEnableDnsHostnames
Indicates whether the instances launched in the VPC get DNS hostnames. -
setEnableDnsHostnames
Indicates whether the instances launched in the VPC get DNS hostnames. -
getEnableDnsSupport
Indicates whether the DNS resolution is supported for the VPC.Returns union: either
BooleanorIResolvable -
setEnableDnsSupport
Indicates whether the DNS resolution is supported for the VPC. -
setEnableDnsSupport
Indicates whether the DNS resolution is supported for the VPC. -
getInstanceTenancy
The allowed tenancy of instances launched into the VPC. -
setInstanceTenancy
The allowed tenancy of instances launched into the VPC. -
getIpv4IpamPoolId
The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. -
setIpv4IpamPoolId
The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. -
getIpv4NetmaskLength
The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. -
setIpv4NetmaskLength
The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. -
getTagsRaw
The tags for the VPC. -
setTagsRaw
The tags for the VPC. -
getVpcEncryptionControl
Describes the configuration and state of VPC encryption controls.Returns union: either
IResolvableorCfnVPC.VpcEncryptionControlProperty -
setVpcEncryptionControl
Describes the configuration and state of VPC encryption controls. -
setVpcEncryptionControl
@Stability(Stable) public void setVpcEncryptionControl(@Nullable CfnVPC.VpcEncryptionControlProperty value) Describes the configuration and state of VPC encryption controls.
-