class VpcV2Base
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.VpcV2Base |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#VpcV2Base |
Java | software.amazon.awscdk.services.ec2.alpha.VpcV2Base |
Python | aws_cdk.aws_ec2_alpha.VpcV2Base |
TypeScript (source) | @aws-cdk/aws-ec2-alpha ยป VpcV2Base |
Implements
IConstruct
, IDependable
, IResource
, IVpc
, IVpc
Extends
Resource
Implemented by
Vpc
Base class for creating a VPC (Virtual Private Cloud) in AWS.
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}.
Initializer
new VpcV2Base(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct
- id
string
- props
Resource
Props
Properties
Name | Type | Description |
---|---|---|
availability | string[] | AZs for this VPC. |
env | Resource | The environment this resource belongs to. |
incomplete | boolean | If this is set to true, don't error out on trying to select subnets. |
internet | IDependable | Dependable that can be depended upon to force internet connectivity established on the VPC. |
ipv4 | string | The primary IPv4 CIDR block associated with the VPC. |
isolated | ISubnet [] | List of isolated subnets in this VPC. |
node | Node | The tree node. |
owner | string | Identifier of the owner for this VPC. |
private | ISubnet [] | List of private subnets in this VPC. |
public | ISubnet [] | List of public subnets in this VPC. |
region | string | Region for this VPC. |
stack | Stack | The stack in which this resource is defined. |
vpc | string | Arn of this VPC. |
vpc | string | CIDR range for this VPC. |
vpc | string | Identifier for this VPC. |
internet | string | Returns the id of the Internet Gateway (if enabled). |
ipv4 | string[] | IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool. |
secondary | IVPCCidr [] | Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range. |
vpn | string | Returns the id of the VPN Gateway (if enabled). |
availabilityZones
Type:
string[]
AZs for this VPC.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
incompleteSubnetDefinition
Type:
boolean
If this is set to true, don't error out on trying to select subnets.
internetConnectivityEstablished
Type:
IDependable
Dependable that can be depended upon to force internet connectivity established on the VPC.
ipv4CidrBlock
Type:
string
The primary IPv4 CIDR block associated with the VPC.
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}.
isolatedSubnets
Type:
ISubnet
[]
List of isolated subnets in this VPC.
node
Type:
Node
The tree node.
ownerAccountId
Type:
string
Identifier of the owner for this VPC.
privateSubnets
Type:
ISubnet
[]
List of private subnets in this VPC.
publicSubnets
Type:
ISubnet
[]
List of public subnets in this VPC.
region
Type:
string
Region for this VPC.
stack
Type:
Stack
The stack in which this resource is defined.
vpcArn
Type:
string
Arn of this VPC.
vpcCidrBlock
Type:
string
CIDR range for this VPC.
vpcId
Type:
string
Identifier for this VPC.
internetGatewayId?
Type:
string
(optional)
Returns the id of the Internet Gateway (if enabled).
ipv4IpamProvisionedCidrs?
Type:
string[]
(optional)
IPv4 CIDR provisioned under pool Required to check for overlapping CIDRs after provisioning is complete under IPAM pool.
secondaryCidrBlock?
Type:
IVPCCidr
[]
(optional)
Secondary IPs for the VPC, can be multiple Ipv4 or Ipv6 Ipv4 should be within RFC#1918 range.
vpnGatewayId?
Type:
string
(optional)
Returns the id of the VPN Gateway (if enabled).
Methods
Name | Description |
---|---|
add | Adds a new client VPN endpoint to this VPC. |
add | Adds a new Egress Only Internet Gateway to this VPC and defines a new route to the route table of given subnets. |
add | Adds a new flow log to this VPC. |
add | Adds a new gateway endpoint to this VPC. |
add | Adds a new interface endpoint to this VPC. |
add | Adds a new Internet Gateway to this VPC. |
add | Adds a new NAT Gateway to the given subnet of this VPC of given subnets. |
add | Adds a new VPN connection to this VPC. |
apply | Apply the given removal policy to this resource. |
create | Creates peering connection role for acceptor VPC. |
create | Creates a peering connection. |
enable | Adds a VPN Gateway to this VPC. |
enable | Adds VPNGAtewayV2 to this VPC. |
select | Return information on the subnets appropriate for the given selection strategy. |
to | Returns a string representation of this construct. |
protected select | Return the subnets appropriate for the placement strategy. |
addClientVpnEndpoint(id, options)
public addClientVpnEndpoint(id: string, options: ClientVpnEndpointOptions): ClientVpnEndpoint
Parameters
- id
string
- options
Client
Vpn Endpoint Options
Returns
Adds a new client VPN endpoint to this VPC.
addEgressOnlyInternetGateway(options?)
public addEgressOnlyInternetGateway(options?: EgressOnlyInternetGatewayOptions): void
Parameters
- options
Egress
Only Internet Gateway Options
Adds a new Egress Only Internet Gateway to this VPC and defines a new route to the route table of given subnets.
addFlowLog(id, options?)
public addFlowLog(id: string, options?: FlowLogOptions): FlowLog
Parameters
- id
string
- options
Flow
Log Options
Returns
Adds a new flow log to this VPC.
addGatewayEndpoint(id, options)
public addGatewayEndpoint(id: string, options: GatewayVpcEndpointOptions): GatewayVpcEndpoint
Parameters
- id
string
- options
Gateway
Vpc Endpoint Options
Returns
Adds a new gateway endpoint to this VPC.
addInterfaceEndpoint(id, options)
public addInterfaceEndpoint(id: string, options: InterfaceVpcEndpointOptions): InterfaceVpcEndpoint
Parameters
- id
string
- options
Interface
Vpc Endpoint Options
Returns
Adds a new interface endpoint to this VPC.
addInternetGateway(options?)
public addInternetGateway(options?: InternetGatewayOptions): void
Parameters
- options
Internet
Gateway Options
Adds a new Internet Gateway to this VPC.
addNatGateway(options)
public addNatGateway(options: NatGatewayOptions): NatGateway
Parameters
- options
Nat
Gateway Options
Returns
Adds a new NAT Gateway to the given subnet of this VPC of given subnets.
addVpnConnection(id, options)
public addVpnConnection(id: string, options: VpnConnectionOptions): VpnConnection
Parameters
- id
string
- options
Vpn
Connection Options
Returns
Adds a new VPN connection to this VPC.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
createAcceptorVpcRole(requestorAccountId)
public createAcceptorVpcRole(requestorAccountId: string): Role
Parameters
- requestorAccountId
string
Returns
Creates peering connection role for acceptor VPC.
createPeeringConnection(id, options)
public createPeeringConnection(id: string, options: VPCPeeringConnectionOptions): VPCPeeringConnection
Parameters
- id
string
- options
VPCPeering
Connection Options
Returns
Creates a peering connection.
enableVpnGateway(options)
public enableVpnGateway(options: EnableVpnGatewayOptions): void
โ ๏ธ Deprecated: use enableVpnGatewayV2 for compatibility with VPCV2.Route
Parameters
- options
Enable
Vpn Gateway Options
Adds a VPN Gateway to this VPC.
enableVpnGatewayV2(options)
public enableVpnGatewayV2(options: VPNGatewayV2Options): VPNGatewayV2
Parameters
- options
VPNGateway
V2 Options
Returns
Adds VPNGAtewayV2 to this VPC.
selectSubnets(selection?)
public selectSubnets(selection?: SubnetSelection): SelectedSubnets
Parameters
- selection
Subnet
Selection
Returns
Return information on the subnets appropriate for the given selection strategy.
Requires that at least one subnet is matched, throws a descriptive error message otherwise.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected selectSubnetObjects(selection?)
protected selectSubnetObjects(selection?: SubnetSelection): ISubnet[]
Parameters
- selection
Subnet
Selection
Returns
ISubnet
[]
Return the subnets appropriate for the placement strategy.