Skip to content

Resource: awsApiGatewayVpcLink

Provides an API Gateway VPC Link.

-> Note: Amazon API Gateway Version 1 VPC Links enable private integrations that connect REST APIs to private resources in a VPC. To enable private integration for HTTP APIs, use the Amazon API Gateway Version 2 VPC Link resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsLbExample = new aws.lb.Lb(this, "example", {
  internal: true,
  loadBalancerType: "network",
  name: "example",
  subnetMapping: [
    {
      subnetId: "12345",
    },
  ],
});
const awsApiGatewayVpcLinkExample = new aws.apiGatewayVpcLink.ApiGatewayVpcLink(
  this,
  "example_1",
  {
    description: "example description",
    name: "example",
    targetArns: [awsLbExample.arn],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsApiGatewayVpcLinkExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Name used to label and identify the VPC link.
  • description - (Optional) Description of the VPC link.
  • targetArns - (Required, ForceNew) List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
  • tags - (Optional) Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Identifier of the VpcLink.
  • tagsAll - Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

API Gateway VPC Link can be imported using the id, e.g.,

$ terraform import aws_api_gateway_vpc_link.example 12345abcde