@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-09T19:16:37.312Z") 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 Overview of VPCs 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 . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnVPC(Construct scope,
java.lang.String id)
Create a new `AWS::EC2::VPC`.
|
|
CfnVPC(Construct scope,
java.lang.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 |
---|---|
java.lang.String |
getAttrCidrBlock()
The primary IPv4 CIDR block for the VPC.
|
java.util.List<java.lang.String> |
getAttrCidrBlockAssociations()
The association IDs of the IPv4 CIDR blocks for the VPC.
|
java.lang.String |
getAttrDefaultNetworkAcl()
The ID of the default network ACL for the VPC.
|
java.lang.String |
getAttrDefaultSecurityGroup()
The ID of the default security group for the VPC.
|
java.util.List<java.lang.String> |
getAttrIpv6CidrBlocks()
The IPv6 CIDR blocks for the VPC.
|
java.lang.String |
getAttrVpcId() |
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getCidrBlock()
The IPv4 network range for the VPC, in CIDR notation.
|
java.lang.Object |
getEnableDnsHostnames()
Indicates whether the instances launched in the VPC get DNS hostnames.
|
java.lang.Object |
getEnableDnsSupport()
Indicates whether the DNS resolution is supported for the VPC.
|
java.lang.String |
getInstanceTenancy()
The allowed tenancy of instances launched into the VPC.
|
java.lang.String |
getIpv4IpamPoolId()
The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.
|
java.lang.Number |
getIpv4NetmaskLength()
The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool.
|
TagManager |
getTags()
The tags for the VPC.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setCidrBlock(java.lang.String value)
The IPv4 network range for the VPC, in CIDR notation.
|
void |
setEnableDnsHostnames(java.lang.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(java.lang.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(java.lang.String value)
The allowed tenancy of instances launched into the VPC.
|
void |
setIpv4IpamPoolId(java.lang.String value)
The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.
|
void |
setIpv4NetmaskLength(java.lang.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.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnVPC(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnVPC(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnVPC(Construct scope, java.lang.String id, 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.public CfnVPC(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrCidrBlock()
For example, 10.0.0.0/16.
public java.util.List<java.lang.String> getAttrCidrBlockAssociations()
For example, [ vpc-cidr-assoc-0280ab6b ].
public java.lang.String getAttrDefaultNetworkAcl()
For example, acl-814dafe3.
public java.lang.String getAttrDefaultSecurityGroup()
For example, sg-b178e0d3.
public java.util.List<java.lang.String> getAttrIpv6CidrBlocks()
For example, [ 2001:db8:1234:1a00::/56 ].
public java.lang.String getAttrVpcId()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getCidrBlock()
For example, 10.0.0.0/16
. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
, we modify it to 100.68.0.0/18
.
You must specify either CidrBlock
or Ipv4IpamPoolId
.
public void setCidrBlock(java.lang.String value)
For example, 10.0.0.0/16
. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
, we modify it to 100.68.0.0/18
.
You must specify either CidrBlock
or Ipv4IpamPoolId
.
public java.lang.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 attributes in your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
public void setEnableDnsHostnames(java.lang.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 attributes in your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
public void setEnableDnsHostnames(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 attributes in your VPC .
You can only enable DNS hostnames if you've enabled DNS support.
public java.lang.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 attributes in your VPC .
public void setEnableDnsSupport(java.lang.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 attributes in your VPC .
public void setEnableDnsSupport(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 attributes in your VPC .
public java.lang.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 runs on dedicated hardware 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.
public void setInstanceTenancy(java.lang.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 runs on dedicated hardware 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.
public java.lang.String getIpv4IpamPoolId()
For more information, see What is IPAM? in the Amazon VPC IPAM User Guide .
You must specify either CidrBlock
or Ipv4IpamPoolId
.
public void setIpv4IpamPoolId(java.lang.String value)
For more information, see What is IPAM? in the Amazon VPC IPAM User Guide .
You must specify either CidrBlock
or Ipv4IpamPoolId
.
public java.lang.Number getIpv4NetmaskLength()
For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide .
public void setIpv4NetmaskLength(java.lang.Number value)
For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide .