java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.apigateway.VpcLink
All Implemented Interfaces:
IResource, IVpcLink, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:11.972Z") @Stability(Stable) public class VpcLink extends Resource implements IVpcLink
Define a new VPC Link Specifies an API Gateway VPC link for a RestApi to access resources in an Amazon Virtual Private Cloud (VPC).

Example:

 import software.amazon.awscdk.services.elasticloadbalancingv2.*;
 Vpc vpc = new Vpc(this, "VPC");
 NetworkLoadBalancer nlb = NetworkLoadBalancer.Builder.create(this, "NLB")
         .vpc(vpc)
         .build();
 VpcLink link = VpcLink.Builder.create(this, "link")
         .targets(List.of(nlb))
         .build();
 Integration integration = Integration.Builder.create()
         .type(IntegrationType.HTTP_PROXY)
         .integrationHttpMethod("ANY")
         .options(IntegrationOptions.builder()
                 .connectionType(ConnectionType.VPC_LINK)
                 .vpcLink(link)
                 .build())
         .build();
 
  • Constructor Details

    • VpcLink

      protected VpcLink(software.amazon.jsii.JsiiObjectRef objRef)
    • VpcLink

      protected VpcLink(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • VpcLink

      @Stability(Stable) public VpcLink(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable VpcLinkProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • VpcLink

      @Stability(Stable) public VpcLink(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromVpcLinkId

      @Stability(Stable) @NotNull public static IVpcLink fromVpcLinkId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String vpcLinkId)
      Import a VPC Link by its Id.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      vpcLinkId - This parameter is required.
    • addTargets

      @Stability(Stable) public void addTargets(@NotNull @NotNull INetworkLoadBalancer... targets)
      Parameters:
      targets - This parameter is required.
    • getVpcLinkId

      @Stability(Stable) @NotNull public String getVpcLinkId()
      Physical ID of the VpcLink resource.
      Specified by:
      getVpcLinkId in interface IVpcLink