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
-
IResourceIConstructIConstructIDependable
Examples
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
}
});
Remarks
ExampleMetadata: infused
Constructors
VpcLink(Construct, string, IVpcLinkProps?)
public VpcLink(Construct scope, string id, IVpcLinkProps? props = null)
Parameters
scope
Constructid
stringprops
IVpcLinkProps
Properties
VpcLinkId
Physical ID of the VpcLink resource.
public virtual string VpcLinkId { get; }
Property Value
Remarks
Attribute: true
Methods
AddTargets(params INetworkLoadBalancer[])
public virtual void AddTargets(params INetworkLoadBalancer[] targets)
Parameters
targets
INetworkLoadBalancer[]
FromVpcLinkId(Construct, string, string)
Import a VPC Link by its Id.
public static IVpcLink FromVpcLinkId(Construct scope, string id, string vpcLinkId)
Parameters
Returns
Validate()
Validate the current construct.
protected override string[] Validate()
Returns
- string[]
Remarks
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.