1. Packages
  2. AWS
  3. API Docs
  4. apigateway
  5. VpcLink
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.apigateway.VpcLink

Explore with Pulumi AI

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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lb.LoadBalancer("example", {
    name: "example",
    internal: true,
    loadBalancerType: "network",
    subnetMappings: [{
        subnetId: "12345",
    }],
});
const exampleVpcLink = new aws.apigateway.VpcLink("example", {
    name: "example",
    description: "example description",
    targetArn: example.arn,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.lb.LoadBalancer("example",
    name="example",
    internal=True,
    load_balancer_type="network",
    subnet_mappings=[{
        "subnet_id": "12345",
    }])
example_vpc_link = aws.apigateway.VpcLink("example",
    name="example",
    description="example description",
    target_arn=example.arn)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
			Name:             pulumi.String("example"),
			Internal:         pulumi.Bool(true),
			LoadBalancerType: pulumi.String("network"),
			SubnetMappings: lb.LoadBalancerSubnetMappingArray{
				&lb.LoadBalancerSubnetMappingArgs{
					SubnetId: pulumi.String("12345"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = apigateway.NewVpcLink(ctx, "example", &apigateway.VpcLinkArgs{
			Name:        pulumi.String("example"),
			Description: pulumi.String("example description"),
			TargetArn:   example.Arn,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.LB.LoadBalancer("example", new()
    {
        Name = "example",
        Internal = true,
        LoadBalancerType = "network",
        SubnetMappings = new[]
        {
            new Aws.LB.Inputs.LoadBalancerSubnetMappingArgs
            {
                SubnetId = "12345",
            },
        },
    });

    var exampleVpcLink = new Aws.ApiGateway.VpcLink("example", new()
    {
        Name = "example",
        Description = "example description",
        TargetArn = example.Arn,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lb.LoadBalancer;
import com.pulumi.aws.lb.LoadBalancerArgs;
import com.pulumi.aws.lb.inputs.LoadBalancerSubnetMappingArgs;
import com.pulumi.aws.apigateway.VpcLink;
import com.pulumi.aws.apigateway.VpcLinkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new LoadBalancer("example", LoadBalancerArgs.builder()
            .name("example")
            .internal(true)
            .loadBalancerType("network")
            .subnetMappings(LoadBalancerSubnetMappingArgs.builder()
                .subnetId("12345")
                .build())
            .build());

        var exampleVpcLink = new VpcLink("exampleVpcLink", VpcLinkArgs.builder()
            .name("example")
            .description("example description")
            .targetArn(example.arn())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:lb:LoadBalancer
    properties:
      name: example
      internal: true
      loadBalancerType: network
      subnetMappings:
        - subnetId: '12345'
  exampleVpcLink:
    type: aws:apigateway:VpcLink
    name: example
    properties:
      name: example
      description: example description
      targetArn: ${example.arn}
Copy

Create VpcLink Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VpcLink(name: string, args: VpcLinkArgs, opts?: CustomResourceOptions);
@overload
def VpcLink(resource_name: str,
            args: VpcLinkArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def VpcLink(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            target_arn: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None)
func NewVpcLink(ctx *Context, name string, args VpcLinkArgs, opts ...ResourceOption) (*VpcLink, error)
public VpcLink(string name, VpcLinkArgs args, CustomResourceOptions? opts = null)
public VpcLink(String name, VpcLinkArgs args)
public VpcLink(String name, VpcLinkArgs args, CustomResourceOptions options)
type: aws:apigateway:VpcLink
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VpcLinkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VpcLinkArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VpcLinkArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VpcLinkArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VpcLinkArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var vpcLinkResource = new Aws.ApiGateway.VpcLink("vpcLinkResource", new()
{
    TargetArn = "string",
    Description = "string",
    Name = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := apigateway.NewVpcLink(ctx, "vpcLinkResource", &apigateway.VpcLinkArgs{
	TargetArn:   pulumi.String("string"),
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var vpcLinkResource = new VpcLink("vpcLinkResource", VpcLinkArgs.builder()
    .targetArn("string")
    .description("string")
    .name("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
vpc_link_resource = aws.apigateway.VpcLink("vpcLinkResource",
    target_arn="string",
    description="string",
    name="string",
    tags={
        "string": "string",
    })
Copy
const vpcLinkResource = new aws.apigateway.VpcLink("vpcLinkResource", {
    targetArn: "string",
    description: "string",
    name: "string",
    tags: {
        string: "string",
    },
});
Copy
type: aws:apigateway:VpcLink
properties:
    description: string
    name: string
    tags:
        string: string
    targetArn: string
Copy

VpcLink Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VpcLink resource accepts the following input properties:

TargetArn
This property is required.
Changes to this property will trigger replacement.
string
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
Description string
Description of the VPC link.
Name string
Name used to label and identify the VPC link.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TargetArn
This property is required.
Changes to this property will trigger replacement.
string
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
Description string
Description of the VPC link.
Name string
Name used to label and identify the VPC link.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
targetArn
This property is required.
Changes to this property will trigger replacement.
String
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
description String
Description of the VPC link.
name String
Name used to label and identify the VPC link.
tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
targetArn
This property is required.
Changes to this property will trigger replacement.
string
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
description string
Description of the VPC link.
name string
Name used to label and identify the VPC link.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
target_arn
This property is required.
Changes to this property will trigger replacement.
str
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
description str
Description of the VPC link.
name str
Name used to label and identify the VPC link.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
targetArn
This property is required.
Changes to this property will trigger replacement.
String
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
description String
Description of the VPC link.
name String
Name used to label and identify the VPC link.
tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpcLink resource produces the following output properties:

Arn string
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing VpcLink Resource

Get an existing VpcLink resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VpcLinkState, opts?: CustomResourceOptions): VpcLink
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        target_arn: Optional[str] = None) -> VpcLink
func GetVpcLink(ctx *Context, name string, id IDInput, state *VpcLinkState, opts ...ResourceOption) (*VpcLink, error)
public static VpcLink Get(string name, Input<string> id, VpcLinkState? state, CustomResourceOptions? opts = null)
public static VpcLink get(String name, Output<String> id, VpcLinkState state, CustomResourceOptions options)
resources:  _:    type: aws:apigateway:VpcLink    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string
Description string
Description of the VPC link.
Name string
Name used to label and identify the VPC link.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TargetArn Changes to this property will trigger replacement. string
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
Arn string
Description string
Description of the VPC link.
Name string
Name used to label and identify the VPC link.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

TargetArn Changes to this property will trigger replacement. string
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
arn String
description String
Description of the VPC link.
name String
Name used to label and identify the VPC link.
tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

targetArn Changes to this property will trigger replacement. String
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
arn string
description string
Description of the VPC link.
name string
Name used to label and identify the VPC link.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

targetArn Changes to this property will trigger replacement. string
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
arn str
description str
Description of the VPC link.
name str
Name used to label and identify the VPC link.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

target_arn Changes to this property will trigger replacement. str
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
arn String
description String
Description of the VPC link.
name String
Name used to label and identify the VPC link.
tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

targetArn Changes to this property will trigger replacement. String
List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.

Import

Using pulumi import, import API Gateway VPC Link using the id. For example:

$ pulumi import aws:apigateway/vpcLink:VpcLink example 12345abcde
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.