@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:06.357Z") @Stability(value=Stable) public class CfnVPC extends CfnResource implements IInspectable
Specifies a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud 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());
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnVPC.Builder
A fluent builder for
CfnVPC. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnVPC(Construct scope,
String id,
CfnVPCProps props)
Create a new `AWS::EC2::VPC`.
|
protected |
CfnVPC(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnVPC(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrCidrBlock()
The set of IP addresses for the VPC.
|
List<String> |
getAttrCidrBlockAssociations()
The IPv4 CIDR block association IDs for the VPC.
|
String |
getAttrDefaultNetworkAcl()
The default network ACL ID that is associated with the VPC.
|
String |
getAttrDefaultSecurityGroup()
The default security group ID that is associated with the VPC.
|
List<String> |
getAttrIpv6CidrBlocks()
The IPv6 CIDR blocks that are associated with the VPC, such as `[ 2001:db8:1234:1a00::/56 ]` .
|
protected Map<String,Object> |
getCfnProperties() |
String |
getCidrBlock()
The primary IPv4 CIDR block for the VPC.
|
Object |
getEnableDnsHostnames()
Indicates whether the instances launched in the VPC get DNS hostnames.
|
Object |
getEnableDnsSupport()
Indicates whether the DNS resolution is supported for the VPC.
|
String |
getInstanceTenancy()
The allowed tenancy of instances launched into the VPC.
|
TagManager |
getTags()
The tags for the VPC.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setCidrBlock(String value)
The primary IPv4 CIDR block for the VPC.
|
void |
setEnableDnsHostnames(Boolean value)
Indicates whether the instances launched in the VPC get DNS hostnames.
|
void |
setEnableDnsHostnames(IResolvable value)
Indicates whether the instances launched in the VPC get DNS hostnames.
|
void |
setEnableDnsSupport(Boolean value)
Indicates whether the DNS resolution is supported for the VPC.
|
void |
setEnableDnsSupport(IResolvable value)
Indicates whether the DNS resolution is supported for the VPC.
|
void |
setInstanceTenancy(String value)
The allowed tenancy of instances launched into the VPC.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnVPC(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnVPC(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnVPC(@NotNull
Construct scope,
@NotNull
String id,
@NotNull
CfnVPCProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrCidrBlock()
For example, 10.0.0.0/16 .
@Stability(value=Stable) @NotNull public List<String> getAttrCidrBlockAssociations()
For example, [ vpc-cidr-assoc-0280ab6b ] .
@Stability(value=Stable) @NotNull public String getAttrDefaultNetworkAcl()
For example, acl-814dafe3 .
@Stability(value=Stable) @NotNull public String getAttrDefaultSecurityGroup()
For example, sg-b178e0d3 .
@Stability(value=Stable) @NotNull public List<String> getAttrIpv6CidrBlocks()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public String getCidrBlock()
@Stability(value=Stable)
public void setCidrBlock(@NotNull
String value)
@Stability(value=Stable) @Nullable public Object getEnableDnsHostnames()
If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS Support in Your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
@Stability(value=Stable)
public void setEnableDnsHostnames(@Nullable
Boolean value)
If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS Support in Your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
@Stability(value=Stable)
public void setEnableDnsHostnames(@Nullable
IResolvable value)
If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS Support in Your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
@Stability(value=Stable) @Nullable public Object getEnableDnsSupport()
If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS Support in Your VPC .
@Stability(value=Stable)
public void setEnableDnsSupport(@Nullable
Boolean value)
If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS Support in Your VPC .
@Stability(value=Stable)
public void setEnableDnsSupport(@Nullable
IResolvable value)
If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS Support in Your VPC .
@Stability(value=Stable) @Nullable public String getInstanceTenancy()
"default" : An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch."dedicated" : An instance launched into the VPC is a Dedicated Instance by default, unless you explicitly specify a tenancy of host during instance launch. You cannot specify a tenancy of default during instance launch.
Updating InstanceTenancy requires no replacement only if you are updating its value from "dedicated" to "default" . Updating InstanceTenancy from "default" to "dedicated" requires replacement.
@Stability(value=Stable)
public void setInstanceTenancy(@Nullable
String value)
"default" : An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch."dedicated" : An instance launched into the VPC is a Dedicated Instance by default, unless you explicitly specify a tenancy of host during instance launch. You cannot specify a tenancy of default during instance launch.
Updating InstanceTenancy requires no replacement only if you are updating its value from "dedicated" to "default" . Updating InstanceTenancy from "default" to "dedicated" requires replacement.
Copyright © 2022. All rights reserved.