Class CfnVPC
Specifies a virtual private cloud (VPC).
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnVPC : CfnResource, IInspectable, IVPCRef, IConstruct, IDependable, IEnvironmentAware, ITaggable
Syntax (vb)
Public Class CfnVPC Inherits CfnResource Implements IInspectable, IVPCRef, IConstruct, IDependable, IEnvironmentAware, ITaggable
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
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 |
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 | Specifies a virtual private cloud (VPC). |
| 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 | Tag Manager which manages the tags for this resource. |
| TagsRaw | The tags for the VPC. |
| VpcRef | A reference to a VPC resource. |
Methods
| ArnForVPC(IVPCRef) | Specifies a virtual private cloud (VPC). |
| FromVpcId(Construct, string, string) | Creates a new IVPCRef from a vpcId. |
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnVPC(object) | Checks whether the given object is a CfnVPC. |
| RenderProperties(IDictionary<string, object>) | Specifies a virtual private cloud (VPC). |
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 string
Construct identifier for this resource (unique in its scope).
- props ICfnVPCProps
Resource properties.
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
Properties
AttrCidrBlock
The primary IPv4 CIDR block for the VPC.
public virtual string AttrCidrBlock { get; }
Property Value
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
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
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
Remarks
For example, sg-b178e0d3.
CloudformationAttribute: DefaultSecurityGroup
AttrIpv6CidrBlocks
The IPv6 CIDR blocks for the VPC.
public virtual string[] AttrIpv6CidrBlocks { get; }
Property Value
string[]
Remarks
For example, [ 2001:db8:1234:1a00::/56 ].
CloudformationAttribute: Ipv6CidrBlocks
AttrVpcId
The ID of the VPC.
public virtual string AttrVpcId { get; }
Property Value
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
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
CfnProperties
Specifies a virtual private cloud (VPC).
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
CidrBlock
The IPv4 network range for the VPC, in CIDR notation.
public virtual string? CidrBlock { get; set; }
Property Value
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
EnableDnsHostnames
Indicates whether the instances launched in the VPC get DNS hostnames.
public virtual object? EnableDnsHostnames { get; set; }
Property Value
Remarks
Type union: either bool or IResolvable
EnableDnsSupport
Indicates whether the DNS resolution is supported for the VPC.
public virtual object? EnableDnsSupport { get; set; }
Property Value
Remarks
Type union: either bool or IResolvable
InstanceTenancy
The allowed tenancy of instances launched into the VPC.
public virtual string? InstanceTenancy { get; set; }
Property Value
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
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
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
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 double? Ipv4NetmaskLength { get; set; }
Property Value
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
TagsRaw
The tags for the VPC.
public virtual ICfnTag[]? TagsRaw { get; set; }
Property Value
ICfnTag[]
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
VpcRef
A reference to a VPC resource.
public virtual IVPCReference VpcRef { get; }
Property Value
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
Methods
ArnForVPC(IVPCRef)
Specifies a virtual private cloud (VPC).
public static string ArnForVPC(IVPCRef resource)
Parameters
- resource IVPCRef
Returns
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
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 }
});
FromVpcId(Construct, string, string)
Creates a new IVPCRef from a vpcId.
public static IVPCRef FromVpcId(Construct scope, string id, string vpcId)
Parameters
Returns
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
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.
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
IsCfnVPC(object)
Checks whether the given object is a CfnVPC.
public static bool IsCfnVPC(object x)
Parameters
- x object
Returns
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused
RenderProperties(IDictionary<string, object>)
Specifies a virtual private cloud (VPC).
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
Remarks
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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpc.html
CloudformationResource: AWS::EC2::VPC
ExampleMetadata: infused