AWS::ApiGateway::VpcLink - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::ApiGateway::VpcLink

The AWS::ApiGateway::VpcLink resource creates an API Gateway VPC link for a REST API 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 Amazon CloudFormation template, use the following syntax:

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

The description of the VPC link.

Required: No

Type: String

Update requires: No interruption

The name used to label and identify the VPC link.

Required: Yes

Type: String

Update requires: No interruption

An array of arbitrary tags (key-value pairs) to associate with the VPC link.

Required: No

Type: Array of Tag

Update requires: No interruption

The ARN of the network load balancer of the VPC targeted by the VPC link. The network load balancer must be owned by the same Amazon Web Services account of the API owner.

Required: Yes

Type: Array of String

Update requires: Replacement

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the VpcLink.

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

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

VpcLinkId

The ID for the VPC link. For example: abc123.

{ "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