AWS::EC2::RouteTable
为指定的 VPC 指定路由表。当您创建路由表后,可以添加路由并将该表与子网关联。
有关更多信息,请参阅 Amazon Virtual Private Cloud 用户指南 中的路由表。
语法
要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:
属性
Tags
-
分配给路由表的任何标签。
必需:否
类型:Tag 的列表
Update requires: No interruption
VpcId
-
VPC 的 ID。
必需:是
类型:字符串
Update requires: Replacement
返回值
Ref
在将此资源的逻辑 ID 传递给内部 Ref
函数时,Ref
返回路由表的 ID。
For more information about using the Ref
function, see Ref.
示例
路由表
以下示例使用来自名为“myVPC”的 VPC 的 VPC ID,该 VPC 是在同一模板中的其他位置声明的。
JSON
"myRouteTable" : { "Type" : "AWS::EC2::RouteTable", "Properties" : { "VpcId" : { "Ref" : "myVPC" }, "Tags" : [ { "Key" : "foo", "Value" : "bar" } ] } }
YAML
myRouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: Ref: myVPC Tags: - Key: foo Value: bar
另请参阅
-
Amazon EC2 API 参考 中的 CreateRouteTable。
-
Amazon VPC 用户指南 中的路由表
-
Amazon Elastic Compute Cloud 用户指南 中的使用标签