Class CfnVPC
A CloudFormation AWS::EC2::VPC
.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class CfnVPC : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnVPC
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Specifies a virtual private cloud (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 Virtual private clouds (VPC) in the Amazon VPC User Guide .
CloudformationResource: AWS::EC2::VPC
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
ExampleMetadata: infused
Examples
CfnInclude cfnTemplate;
// using from*Attributes()
CfnSubnet privateCfnSubnet1;
CfnSubnet privateCfnSubnet2;
// using from*Name()
var cfnBucket = (CfnBucket)cfnTemplate.GetResource("Bucket");
var bucket = Bucket.FromBucketName(this, "L2Bucket", cfnBucket.Ref);
// using from*Arn()
var cfnKey = (CfnKey)cfnTemplate.GetResource("Key");
var key = Key.FromKeyArn(this, "L2Key", cfnKey.AttrArn);
var cfnVpc = (CfnVPC)cfnTemplate.GetResource("Vpc");
var vpc = Vpc.FromVpcAttributes(this, "L2Vpc", new VpcAttributes {
VpcId = cfnVpc.Ref,
AvailabilityZones = Fn.GetAzs(),
PrivateSubnetIds = new [] { privateCfnSubnet1.Ref, privateCfnSubnet2.Ref }
});
Synopsis
Constructors
CfnVPC(Construct, String, ICfnVPCProps) | Create a new |
CfnVPC(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnVPC(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrCidrBlock | The primary IPv4 CIDR block for the VPC. |
AttrCidrBlockAssociations | The association IDs of the IPv4 CIDR blocks for the VPC. |
AttrDefaultNetworkAcl | The ID of the default network ACL for the VPC. |
AttrDefaultSecurityGroup | The ID of the default security group for the VPC. |
AttrIpv6CidrBlocks | The IPv6 CIDR blocks for the VPC. |
AttrVpcId | The ID of the VPC. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
CidrBlock | The IPv4 network range for the VPC, in CIDR notation. |
EnableDnsHostnames | Indicates whether the instances launched in the VPC get DNS hostnames. |
EnableDnsSupport | Indicates whether the DNS resolution is supported for the VPC. |
InstanceTenancy | The allowed tenancy of instances launched into the VPC. |
Ipv4IpamPoolId | The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. |
Ipv4NetmaskLength | The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. |
Tags | The tags for the VPC. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnVPC(Construct, String, ICfnVPCProps)
Create a new AWS::EC2::VPC
.
public CfnVPC(Construct scope, string id, ICfnVPCProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnVPCProps
- resource properties.
CfnVPC(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnVPC(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnVPC(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnVPC(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrCidrBlock
The primary IPv4 CIDR block for the VPC.
public virtual string AttrCidrBlock { get; }
Property Value
System.String
Remarks
For example, 10.0.0.0/16.
CloudformationAttribute: CidrBlock
AttrCidrBlockAssociations
The association IDs of the IPv4 CIDR blocks for the VPC.
public virtual string[] AttrCidrBlockAssociations { get; }
Property Value
System.String[]
Remarks
For example, [ vpc-cidr-assoc-0280ab6b ].
CloudformationAttribute: CidrBlockAssociations
AttrDefaultNetworkAcl
The ID of the default network ACL for the VPC.
public virtual string AttrDefaultNetworkAcl { get; }
Property Value
System.String
Remarks
For example, acl-814dafe3.
CloudformationAttribute: DefaultNetworkAcl
AttrDefaultSecurityGroup
The ID of the default security group for the VPC.
public virtual string AttrDefaultSecurityGroup { get; }
Property Value
System.String
Remarks
For example, sg-b178e0d3.
CloudformationAttribute: DefaultSecurityGroup
AttrIpv6CidrBlocks
The IPv6 CIDR blocks for the VPC.
public virtual string[] AttrIpv6CidrBlocks { get; }
Property Value
System.String[]
Remarks
For example, [ 2001:db8:1234:1a00::/56 ].
CloudformationAttribute: Ipv6CidrBlocks
AttrVpcId
The ID of the VPC.
public virtual string AttrVpcId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: VpcId
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
CidrBlock
The IPv4 network range for the VPC, in CIDR notation.
public virtual string CidrBlock { get; set; }
Property Value
System.String
Remarks
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
.
EnableDnsHostnames
Indicates whether the instances launched in the VPC get DNS hostnames.
public virtual object EnableDnsHostnames { get; set; }
Property Value
System.Object
Remarks
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.
EnableDnsSupport
Indicates whether the DNS resolution is supported for the VPC.
public virtual object EnableDnsSupport { get; set; }
Property Value
System.Object
Remarks
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 .
InstanceTenancy
The allowed tenancy of instances launched into the VPC.
public virtual string InstanceTenancy { get; set; }
Property Value
System.String
Remarks
Updating InstanceTenancy
requires no replacement only if you are updating its value from dedicated
to default
. Updating InstanceTenancy
from default
to dedicated
requires replacement.
Ipv4IpamPoolId
The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.
public virtual string Ipv4IpamPoolId { get; set; }
Property Value
System.String
Remarks
For more information, see What is IPAM? in the Amazon VPC IPAM User Guide .
You must specify either CidrBlock
or Ipv4IpamPoolId
.
Ipv4NetmaskLength
The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool.
public virtual Nullable<double> Ipv4NetmaskLength { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
For more information about IPAM, see What is IPAM? in the Amazon VPC IPAM User Guide .
Tags
The tags for the VPC.
public virtual TagManager Tags { get; }
Property Value
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>