interface IVpc
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.IVpc |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#IVpc |
Java | software.amazon.awscdk.services.ec2.IVpc |
Python | aws_cdk.aws_ec2.IVpc |
TypeScript (source) | aws-cdk-lib » aws_ec2 » IVpc |
Obtainable from
Vpc
.fromLookup()
, Vpc
.fromVpcAttributes()
Properties
Name | Type | Description |
---|---|---|
availability | string[] | AZs for this VPC. |
env | Resource | The environment this resource belongs to. |
internet | IDependable | Dependable that can be depended upon to force internet connectivity established on the VPC. |
isolated | ISubnet [] | List of isolated subnets in this VPC. |
node | Node | The tree node. |
private | ISubnet [] | List of private subnets in this VPC. |
public | ISubnet [] | List of public subnets in this VPC. |
stack | Stack | The stack in which this resource is defined. |
vpc | string | ARN for this VPC. |
vpc | string | CIDR range for this VPC. |
vpc | string | Identifier for this VPC. |
vpn | string | Identifier for the VPN gateway. |
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.
internetConnectivityEstablished
Type:
IDependable
Dependable that can be depended upon to force internet connectivity established on the VPC.
isolatedSubnets
Type:
ISubnet
[]
List of isolated subnets in this VPC.
node
Type:
Node
The tree node.
privateSubnets
Type:
ISubnet
[]
List of private subnets in this VPC.
publicSubnets
Type:
ISubnet
[]
List of public subnets in this VPC.
stack
Type:
Stack
The stack in which this resource is defined.
vpcArn
Type:
string
ARN for this VPC.
vpcCidrBlock
Type:
string
CIDR range for this VPC.
vpcId
Type:
string
Identifier for this VPC.
vpnGatewayId?
Type:
string
(optional)
Identifier for the VPN gateway.
Methods
Name | Description |
---|---|
add | Adds a new client VPN endpoint to this VPC. |
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 VPN connection to this VPC. |
apply | Apply the given removal policy to this resource. |
enable | Adds a VPN Gateway to this VPC. |
select | Return information on the subnets appropriate for the given selection strategy. |
ClientVpnEndpoint(id, options)
addpublic addClientVpnEndpoint(id: string, options: ClientVpnEndpointOptions): ClientVpnEndpoint
Parameters
- id
string
- options
Client
Vpn Endpoint Options
Returns
Adds a new client VPN endpoint to this VPC.
FlowLog(id, options?)
addpublic addFlowLog(id: string, options?: FlowLogOptions): FlowLog
Parameters
- id
string
- options
Flow
Log Options
Returns
Adds a new Flow Log to this VPC.
GatewayEndpoint(id, options)
addpublic addGatewayEndpoint(id: string, options: GatewayVpcEndpointOptions): GatewayVpcEndpoint
Parameters
- id
string
- options
Gateway
Vpc Endpoint Options
Returns
Adds a new gateway endpoint to this VPC.
InterfaceEndpoint(id, options)
addpublic addInterfaceEndpoint(id: string, options: InterfaceVpcEndpointOptions): InterfaceVpcEndpoint
Parameters
- id
string
- options
Interface
Vpc Endpoint Options
Returns
Adds a new interface endpoint to this VPC.
VpnConnection(id, options)
addpublic addVpnConnection(id: string, options: VpnConnectionOptions): VpnConnection
Parameters
- id
string
- options
Vpn
Connection Options
Returns
Adds a new VPN connection to this VPC.
RemovalPolicy(policy)
applypublic 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
).
VpnGateway(options)
enablepublic enableVpnGateway(options: EnableVpnGatewayOptions): void
Parameters
- options
Enable
Vpn Gateway Options
Adds a VPN Gateway to this VPC.
Subnets(selection?)
selectpublic 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.