Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::ApiGateway::VpcLink

The AWS::ApiGateway::VpcLink resource specifies an API Gateway VPC link for a AWS::ApiGateway::RestApi to access resources in an Amazon Virtual Private Cloud (VPC). For more information, see vpclink:create in the Amazon API Gateway REST API Reference

To declare this entity in your AWS CloudFormation template, use the following syntax:

{ "Type" : "AWS::ApiGateway::VpcLink", "Properties" : { "Description" : String, "Name" : String, "TargetArns" : [ String, ... ] } }
Type: AWS::ApiGateway::VpcLink Properties: Description: String Name: String TargetArns: - String

Properties

Description

The description of the VPC link.

Required: No

Type: String

Update requires: No interruption

Name

The name used to label and identify the VPC link.

Required: Yes

Type: String

Update requires: No interruption

TargetArns

The ARNs of network load balancers of the VPC targeted by the VPC link. The network load balancers must be owned by the same AWS account of the API owner.

Required: Yes

List of Type: String

Update requires: Replacement

Return Value

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the ID of the VpcLink.

For more information about using the Ref function, see Ref.

{ "Parameters": { "description": { "Type": "String" }, "name": { "Type": "String" } }, "Resources": { "MyVpcLink": { "Type": "AWS::ApiGateway::VpcLink", "Properties": { "Description": { "Ref": "description" }, "Name": { "Ref": "name" }, "TargetArns": [ { "Ref": "MyLoadBalancer" } ] } }, "MyLoadBalancer": { "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", "Properties": { "Type": "network", "Subnets": [ { "Ref": "MySubnet" } ] } }, "MySubnet": { "Type": "AWS::EC2::Subnet", "Properties": { "VpcId": { "Ref": "MyVPC" }, "CidrBlock": "10.0.0.0/24" } }, "MyVPC": { "Type": "AWS::EC2::VPC", "Properties": { "CidrBlock": "10.0.0.0/16" } }, "MyInternetGateway": { "Type": "AWS::EC2::InternetGateway" }, "MyInternetGatewayAttachment": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { "VpcId": { "Ref": "MyVPC" }, "InternetGatewayId": { "Ref": "MyInternetGateway" } } } } }
Parameters: description: Type: String name: Type: String Resources: MyVpcLink: Type: AWS::ApiGateway::VpcLink Properties: Description: !Ref description Name: !Ref name TargetArns: - !Ref MyLoadBalancer MyLoadBalancer: Type: AWS::ElasticLoadBalancingV2::LoadBalancer Properties: Type: network Subnets: - !Ref MySubnet MySubnet: Type: AWS::EC2::Subnet Properties: VpcId: !Ref MyVPC CidrBlock: 10.0.0.0/24 MyVPC: Type: AWS::EC2::VPC Properties: CidrBlock: 10.0.0.0/16 MyInternetGateway: Type: AWS::EC2::InternetGateway MyInternetGatewayAttachment: Type: AWS::EC2::VPCGatewayAttachment Properties: VpcId: !Ref MyVPC InternetGatewayId: !Ref MyInternetGateway