Class VpcV2Base
(experimental) Base class for creating a VPC (Virtual Private Cloud) in AWS.
Inherited Members
Namespace: Amazon.CDK.AWS.ec2.Alpha
Assembly: Amazon.CDK.AWS.ec2.Alpha.dll
Syntax (csharp)
public abstract class VpcV2Base : Resource, IVpcV2, IVpc, IResource, IVPCRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public MustInherit Class VpcV2Base Inherits Resource Implements IVpcV2, IVpc, IResource, IVPCRef, IConstruct, IDependable, IEnvironmentAware
Remarks
For more information, see the {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html AWS CDK Documentation on VPCs}.
Stability: Experimental
Synopsis
Constructors
| VpcV2Base(Construct, string, IResourceProps?) | (experimental) Base class for creating a VPC (Virtual Private Cloud) in AWS. |
Properties
| AvailabilityZones | (experimental) AZs for this VPC. |
| EgressOnlyInternetGatewayId | (experimental) Returns the id of the Egress Only Internet Gateway (if enabled). |
| IncompleteSubnetDefinition | (experimental) If this is set to true, don't error out on trying to select subnets. |
| InternetConnectivityEstablished | (experimental) Dependable that can be depended upon to force internet connectivity established on the VPC. |
| InternetGatewayId | (experimental) Returns the id of the Internet Gateway (if enabled). |
| Ipv4CidrBlock | (experimental) The primary IPv4 CIDR block associated with the VPC. |
| Ipv4IpamProvisionedCidrs | (experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool. |
| IsolatedSubnets | (experimental) List of isolated subnets in this VPC. |
| OwnerAccountId | (experimental) Identifier of the owner for this VPC. |
| PrivateSubnets | (experimental) List of private subnets in this VPC. |
| PublicSubnets | (experimental) List of public subnets in this VPC. |
| Region | (experimental) Region for this VPC. |
| SecondaryCidrBlock | (experimental) Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range. |
| VpcArn | (experimental) Arn of this VPC. |
| VpcCidrBlock | (experimental) CIDR range for this VPC. |
| VpcId | (experimental) Identifier for this VPC. |
| VpcName | (experimental) VpcName to be used for tagging its components. |
| VpcRef | (experimental) A reference to a VPC resource. |
| VpnGatewayId | (experimental) Returns the id of the VPN Gateway (if enabled). |
Methods
| AddClientVpnEndpoint(string, IClientVpnEndpointOptions) | (experimental) Adds a new client VPN endpoint to this VPC. |
| AddEgressOnlyInternetGateway(IEgressOnlyInternetGatewayOptions?) | (experimental) Adds a new Egress Only Internet Gateway to this VPC and defines a new route to the route table of given subnets. |
| AddFlowLog(string, IFlowLogOptions?) | (experimental) Adds a new flow log to this VPC. |
| AddGatewayEndpoint(string, IGatewayVpcEndpointOptions) | (experimental) Adds a new gateway endpoint to this VPC. |
| AddInterfaceEndpoint(string, IInterfaceVpcEndpointOptions) | (experimental) Adds a new interface endpoint to this VPC. |
| AddInternetGateway(IInternetGatewayOptions?) | (experimental) Adds a new Internet Gateway to this VPC. |
| AddNatGateway(INatGatewayOptions) | (experimental) Adds a new NAT Gateway to the given subnet of this VPC of given subnets. |
| AddVpnConnection(string, IVpnConnectionOptions) | (experimental) Adds a new VPN connection to this VPC. |
| CreateAcceptorVpcRole(string) | (experimental) Creates peering connection role for acceptor VPC. |
| CreatePeeringConnection(string, IVPCPeeringConnectionOptions) | (experimental) Creates a peering connection. |
| EnableVpnGateway(IEnableVpnGatewayOptions) | (deprecated) Adds a VPN Gateway to this VPC. |
| EnableVpnGatewayV2(IVPNGatewayV2Options) | (experimental) Adds VPNGAtewayV2 to this VPC. |
| SelectSubnetObjects(ISubnetSelection?) | (experimental) Return the subnets appropriate for the placement strategy. |
| SelectSubnets(ISubnetSelection?) | (experimental) Return information on the subnets appropriate for the given selection strategy. |
Constructors
VpcV2Base(Construct, string, IResourceProps?)
(experimental) Base class for creating a VPC (Virtual Private Cloud) in AWS.
protected VpcV2Base(Construct scope, string id, IResourceProps? props = null)
Parameters
- scope Construct
- id string
- props IResourceProps
Remarks
For more information, see the {@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html AWS CDK Documentation on VPCs}.
Stability: Experimental
Properties
AvailabilityZones
(experimental) AZs for this VPC.
public virtual string[] AvailabilityZones { get; }
Property Value
string[]
Remarks
Stability: Experimental
EgressOnlyInternetGatewayId
(experimental) Returns the id of the Egress Only Internet Gateway (if enabled).
public virtual string? EgressOnlyInternetGatewayId { get; }
Property Value
Remarks
Stability: Experimental
IncompleteSubnetDefinition
(experimental) If this is set to true, don't error out on trying to select subnets.
protected virtual bool IncompleteSubnetDefinition { get; set; }
Property Value
Remarks
Stability: Experimental
InternetConnectivityEstablished
(experimental) Dependable that can be depended upon to force internet connectivity established on the VPC.
public abstract IDependable InternetConnectivityEstablished { get; }
Property Value
IDependable
Remarks
Stability: Experimental
InternetGatewayId
(experimental) Returns the id of the Internet Gateway (if enabled).
public virtual string? InternetGatewayId { get; }
Property Value
Remarks
Stability: Experimental
Ipv4CidrBlock
(experimental) The primary IPv4 CIDR block associated with the VPC.
public abstract string Ipv4CidrBlock { get; }
Property Value
Remarks
Needed in order to validate the vpc range of subnet current prop vpcCidrBlock refers to the token value For more information, see the {@link https://docs.aws.amazon.com/vpc/latest/userguide/vpc-cidr-blocks.html#vpc-sizing-ipv4}.
Stability: Experimental
Ipv4IpamProvisionedCidrs
(experimental) IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
public abstract string[]? Ipv4IpamProvisionedCidrs { get; }
Property Value
string[]
Remarks
Stability: Experimental
IsolatedSubnets
(experimental) List of isolated subnets in this VPC.
public abstract ISubnet[] IsolatedSubnets { get; }
Property Value
ISubnet[]
Remarks
Stability: Experimental
OwnerAccountId
(experimental) Identifier of the owner for this VPC.
public abstract string OwnerAccountId { get; }
Property Value
Remarks
Stability: Experimental
PrivateSubnets
(experimental) List of private subnets in this VPC.
public virtual ISubnet[] PrivateSubnets { get; }
Property Value
ISubnet[]
Remarks
Stability: Experimental
PublicSubnets
(experimental) List of public subnets in this VPC.
public virtual ISubnet[] PublicSubnets { get; }
Property Value
ISubnet[]
Remarks
Stability: Experimental
Region
(experimental) Region for this VPC.
public abstract string Region { get; }
Property Value
Remarks
Stability: Experimental
SecondaryCidrBlock
(experimental) Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range.
public abstract IVPCCidrBlock[]? SecondaryCidrBlock { get; }
Property Value
Remarks
Stability: Experimental
VpcArn
(experimental) Arn of this VPC.
public abstract string VpcArn { get; }
Property Value
Remarks
Stability: Experimental
VpcCidrBlock
(experimental) CIDR range for this VPC.
public abstract string VpcCidrBlock { get; }
Property Value
Remarks
Stability: Experimental
VpcId
(experimental) Identifier for this VPC.
public abstract string VpcId { get; }
Property Value
Remarks
Stability: Experimental
VpcName
(experimental) VpcName to be used for tagging its components.
public abstract string? VpcName { get; }
Property Value
Remarks
Stability: Experimental
VpcRef
(experimental) A reference to a VPC resource.
public virtual IVPCReference VpcRef { get; }
Property Value
Remarks
Stability: Experimental
VpnGatewayId
(experimental) Returns the id of the VPN Gateway (if enabled).
public virtual string? VpnGatewayId { get; }
Property Value
Remarks
Stability: Experimental
Methods
AddClientVpnEndpoint(string, IClientVpnEndpointOptions)
(experimental) Adds a new client VPN endpoint to this VPC.
public virtual ClientVpnEndpoint AddClientVpnEndpoint(string id, IClientVpnEndpointOptions options)
Parameters
- id string
- options IClientVpnEndpointOptions
Returns
Remarks
Stability: Experimental
AddEgressOnlyInternetGateway(IEgressOnlyInternetGatewayOptions?)
(experimental) Adds a new Egress Only Internet Gateway to this VPC and defines a new route to the route table of given subnets.
public virtual EgressOnlyInternetGateway AddEgressOnlyInternetGateway(IEgressOnlyInternetGatewayOptions? options = null)
Parameters
Returns
Remarks
Default: - in case of no input subnets, no route is created
Stability: Experimental
AddFlowLog(string, IFlowLogOptions?)
(experimental) Adds a new flow log to this VPC.
public virtual FlowLog AddFlowLog(string id, IFlowLogOptions? options = null)
Parameters
- id string
- options IFlowLogOptions
Returns
Remarks
Stability: Experimental
AddGatewayEndpoint(string, IGatewayVpcEndpointOptions)
(experimental) Adds a new gateway endpoint to this VPC.
public virtual GatewayVpcEndpoint AddGatewayEndpoint(string id, IGatewayVpcEndpointOptions options)
Parameters
- id string
- options IGatewayVpcEndpointOptions
Returns
Remarks
Stability: Experimental
AddInterfaceEndpoint(string, IInterfaceVpcEndpointOptions)
(experimental) Adds a new interface endpoint to this VPC.
public virtual InterfaceVpcEndpoint AddInterfaceEndpoint(string id, IInterfaceVpcEndpointOptions options)
Parameters
- id string
- options IInterfaceVpcEndpointOptions
Returns
Remarks
Stability: Experimental
AddInternetGateway(IInternetGatewayOptions?)
(experimental) Adds a new Internet Gateway to this VPC.
public virtual InternetGateway AddInternetGateway(IInternetGatewayOptions? options = null)
Parameters
- options IInternetGatewayOptions
Returns
Remarks
Default: - creates a new route for public subnets(with all outbound access) to the Internet Gateway.
Stability: Experimental
AddNatGateway(INatGatewayOptions)
(experimental) Adds a new NAT Gateway to the given subnet of this VPC of given subnets.
public virtual NatGateway AddNatGateway(INatGatewayOptions options)
Parameters
- options INatGatewayOptions
Returns
Remarks
Stability: Experimental
AddVpnConnection(string, IVpnConnectionOptions)
(experimental) Adds a new VPN connection to this VPC.
public virtual VpnConnection AddVpnConnection(string id, IVpnConnectionOptions options)
Parameters
- id string
- options IVpnConnectionOptions
Returns
Remarks
Stability: Experimental
CreateAcceptorVpcRole(string)
(experimental) Creates peering connection role for acceptor VPC.
public virtual Role CreateAcceptorVpcRole(string requestorAccountId)
Parameters
- requestorAccountId string
Returns
Remarks
Stability: Experimental
CreatePeeringConnection(string, IVPCPeeringConnectionOptions)
(experimental) Creates a peering connection.
public virtual VPCPeeringConnection CreatePeeringConnection(string id, IVPCPeeringConnectionOptions options)
Parameters
- id string
- options IVPCPeeringConnectionOptions
Returns
Remarks
Stability: Experimental
EnableVpnGateway(IEnableVpnGatewayOptions)
(deprecated) Adds a VPN Gateway to this VPC.
[Obsolete("use enableVpnGatewayV2 for compatibility with VPCV2.Route")]
public virtual void EnableVpnGateway(IEnableVpnGatewayOptions options)
Parameters
- options IEnableVpnGatewayOptions
Remarks
Stability: Deprecated
EnableVpnGatewayV2(IVPNGatewayV2Options)
(experimental) Adds VPNGAtewayV2 to this VPC.
public virtual VPNGatewayV2 EnableVpnGatewayV2(IVPNGatewayV2Options options)
Parameters
- options IVPNGatewayV2Options
Returns
Remarks
Stability: Experimental
SelectSubnetObjects(ISubnetSelection?)
(experimental) Return the subnets appropriate for the placement strategy.
protected virtual ISubnet[] SelectSubnetObjects(ISubnetSelection? selection = null)
Parameters
- selection ISubnetSelection
Returns
ISubnet[]
Remarks
Stability: Experimental
SelectSubnets(ISubnetSelection?)
(experimental) Return information on the subnets appropriate for the given selection strategy.
public virtual ISelectedSubnets SelectSubnets(ISubnetSelection? selection = null)
Parameters
- selection ISubnetSelection
Returns
Remarks
Requires that at least one subnet is matched, throws a descriptive error message otherwise.
Stability: Experimental