Table of Contents

Class VpcLink

Namespace
Amazon.CDK.AWS.APIGateway
Assembly
Amazon.CDK.AWS.APIGateway.dll

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

public class VpcLink : Resource, IVpcLink, IResource, IConstruct, IConstruct, IDependable
Inheritance
VpcLink
Implements
IResource
IConstruct
IConstruct
IDependable
using Amazon.CDK.AWS.ElasticLoadBalancingV2;


            var vpc = new Vpc(this, "VPC");
            var nlb = new NetworkLoadBalancer(this, "NLB", new NetworkLoadBalancerProps {
                Vpc = vpc
            });
            var link = new VpcLink(this, "link", new VpcLinkProps {
                Targets = new [] { nlb }
            });

            var integration = new Integration(new IntegrationProps {
                Type = IntegrationType.HTTP_PROXY,
                Options = new IntegrationOptions {
                    ConnectionType = ConnectionType.VPC_LINK,
                    VpcLink = link
                }
            });

ExampleMetadata: infused

Constructors

public VpcLink(Construct scope, string id, IVpcLinkProps? props = null)

Parameters

scope Construct
id string
props IVpcLinkProps

Properties

Physical ID of the VpcLink resource.

public virtual string VpcLinkId { get; }

Property Value

string

Attribute: true

Methods

public virtual void AddTargets(params INetworkLoadBalancer[] targets)

Parameters

targets INetworkLoadBalancer[]

Import a VPC Link by its Id.

public static IVpcLink FromVpcLinkId(Construct scope, string id, string vpcLinkId)

Parameters

scope Construct
id string
vpcLinkId string

Returns

IVpcLink

Validate the current construct.

protected override string[] Validate()

Returns

string[]

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.