@aws-cdk_aws-apigatewayv2-alpha.VpcLink

class VpcLink (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.VpcLink
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#VpcLink
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.VpcLink
Pythonaws_cdk.aws_apigatewayv2_alpha.VpcLink
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป VpcLink

Implements IConstruct, IDependable, IResource, IVpcLink

Define a new VPC Link Specifies an API Gateway VPC link for a HTTP API to access resources in an Amazon Virtual Private Cloud (VPC).

Example

import * as ec2 from 'aws-cdk-lib/aws-ec2';

const vpc = new ec2.Vpc(this, 'VPC');
const vpcLink = new apigwv2.VpcLink(this, 'VpcLink', { vpc });

Initializer

new VpcLink(scope: Construct, id: string, props: VpcLinkProps)

Parameters

  • scope Construct
  • id string
  • props VpcLinkProps

Construct Props

NameTypeDescription
vpc๐Ÿ”นIVpcThe VPC in which the private resources reside.
securityGroups?๐Ÿ”นISecurityGroup[]A list of security groups for the VPC link.
subnets?๐Ÿ”นSubnetSelectionA list of subnets for the VPC link.
vpcLinkName?๐Ÿ”นstringThe name used to label and identify the VPC link.

vpc๐Ÿ”น

Type: IVpc

The VPC in which the private resources reside.


securityGroups?๐Ÿ”น

Type: ISecurityGroup[] (optional, default: no security groups. Use addSecurityGroups to add security groups)

A list of security groups for the VPC link.


subnets?๐Ÿ”น

Type: SubnetSelection (optional, default: private subnets of the provided VPC. Use addSubnets to add more subnets)

A list of subnets for the VPC link.


vpcLinkName?๐Ÿ”น

Type: string (optional, default: automatically generated name)

The name used to label and identify the VPC link.

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
vpc๐Ÿ”นIVpcThe VPC to which this VPC Link is associated with.
vpcLinkId๐Ÿ”นstringPhysical ID of the VpcLink resource.

env๐Ÿ”น

Type: ResourceEnvironment

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.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


vpc๐Ÿ”น

Type: IVpc

The VPC to which this VPC Link is associated with.


vpcLinkId๐Ÿ”น

Type: string

Physical ID of the VpcLink resource.

Methods

NameDescription
addSecurityGroups(...groups)๐Ÿ”นAdds the provided security groups to the vpc link.
addSubnets(...subnets)๐Ÿ”นAdds the provided subnets to the vpc link.
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromVpcLinkAttributes(scope, id, attrs)๐Ÿ”นImport a VPC Link by specifying its attributes.

addSecurityGroups(...groups)๐Ÿ”น

public addSecurityGroups(...groups: ISecurityGroup[]): void

Parameters

  • groups ISecurityGroup

Adds the provided security groups to the vpc link.


addSubnets(...subnets)๐Ÿ”น

public addSubnets(...subnets: ISubnet[]): void

Parameters

  • subnets ISubnet

Adds the provided subnets to the vpc link.


applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromVpcLinkAttributes(scope, id, attrs)๐Ÿ”น

public static fromVpcLinkAttributes(scope: Construct, id: string, attrs: VpcLinkAttributes): IVpcLink

Parameters

  • scope Construct
  • id string
  • attrs VpcLinkAttributes

Returns

  • IVpcLink

Import a VPC Link by specifying its attributes.