AWS::ApiGateway::VpcLink - AWS CloudFormation
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

AWS::ApiGateway::VpcLink

AWS::ApiGateway::VpcLink 资源为 REST API 创建 API Gateway VPC 链接以访问 Amazon Virtual Private Cloud (VPC) 中的资源。有关更多信息,请参阅 Amazon API Gateway REST API Reference 中的 vpclink:create

要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:

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

VPC 链接的描述。

必需:否

类型:字符串

Update requires: No interruption

Name

VPC 链接的名称。

必需:是

类型:字符串

Update requires: No interruption

TargetArns

VPC 链接指向的 VPC 的网络负载均衡器的 ARN。网络负载均衡器必须由 API 拥有者的同一个 AWS 账户所有。

必需:是

类型:字符串列表

Update requires: Replacement

在将此资源的逻辑 ID 传递给内部 Ref 函数时,Ref 返回 VpcLink 的 ID。

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