Show / Hide Table of Contents

Class CfnVPC

Specifies a virtual private cloud (VPC).

Inheritance
object
CfnElement
CfnRefElement
CfnResource
CfnVPC
Implements
IInspectable
IVPCRef
IConstruct
IDependable
IEnvironmentAware
ITaggable
Inherited Members
CfnResource.IsCfnResource(object)
CfnResource.AddDeletionOverride(string)
CfnResource.AddDependency(CfnResource)
CfnResource.AddDependsOn(CfnResource)
CfnResource.AddMetadata(string, object)
CfnResource.AddOverride(string, object)
CfnResource.AddPropertyDeletionOverride(string)
CfnResource.AddPropertyOverride(string, object)
CfnResource.ApplyRemovalPolicy(RemovalPolicy?, IRemovalPolicyOptions)
CfnResource.GetAtt(string, ResolutionTypeHint?)
CfnResource.GetMetadata(string)
CfnResource.ObtainDependencies()
CfnResource.ObtainResourceDependencies()
CfnResource.RemoveDependency(CfnResource)
CfnResource.ReplaceDependency(CfnResource, CfnResource)
CfnResource.ShouldSynthesize()
CfnResource.ToString()
CfnResource.ValidateProperties(object)
CfnResource.CfnOptions
CfnResource.CfnResourceType
CfnResource.Env
CfnResource.UpdatedProperites
CfnResource.UpdatedProperties
CfnRefElement.Ref
CfnElement.IsCfnElement(object)
CfnElement.OverrideLogicalId(string)
CfnElement.CreationStack
CfnElement.LogicalId
CfnElement.Stack
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 AWS::EC2::VPC.

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

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

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

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

string

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

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

string

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

IDictionary<string, object>

Overrides
CfnResource.CfnProperties
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

string

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

object

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

object

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

string

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

string

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

double?

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

TagManager

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

IVPCReference

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

string

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
scope Construct
id string
vpcId string
Returns

IVPCRef

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

bool

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

IDictionary<string, object>

Overrides
CfnResource.RenderProperties(IDictionary<string, object>)
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

Implements

IInspectable
IVPCRef
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
ITaggable
Back to top Generated by DocFX