ALIYUN::VPC::RouteTable類型用於建立一個自訂路由表。
目前不支援在以下地區建立路由表:
華北2(北京)
華南1(深圳)
華東1(杭州)
文法
{
"Type": "ALIYUN::VPC::RouteTable",
"Properties": {
"RouteTableName": String,
"VpcId": String,
"Description": String,
"AssociateType": String,
"Tags": List
}
}屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
VpcId | String | 是 | 否 | 自訂路由表所屬的VPC ID。 | 無 |
RouteTableName | String | 否 | 是 | 路由表的名稱。 | 長度為2~128個字元。必須以英文字母或漢字開頭,不能以 |
Description | String | 否 | 是 | 路由表的描述資訊。 | 長度為2~256個字元。必須以英文字母或漢字開頭,不能以 |
AssociateType | String | 否 | 否 | 建立的路由表的類型。 | 取值:
|
Tags | List | 否 | 否 | 標籤。 | 最多設定20個標籤,每個標籤由索引值對組成。標籤值可以為空白。 詳情請參見Tags屬性。 |
Tags文法
"Tags": [
{
"Value": String,
"Key": String
}
] Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標籤鍵 | 長度為1~128個字元,不能以 |
Value | String | 否 | 否 | 標籤值 | 長度為0~128個字元,不能以 |
傳回值
Fn::GetAtt
RouteTableId:路由表ID。
VpcId:自訂路由表所屬的VPC ID。
RouteTableName:路由表的名稱。
RouteTableType:路由表的類型。
VSwitchIds:VPC下的交換器列表。
樣本
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
RouteTableName:
Type: String
Description: The name of the route table.The name must be 2 to 128 characters in length. It can contain letters, numbers, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Resources:
RouteTable:
Type: ALIYUN::VPC::RouteTable
Properties:
RouteTableName: TestRouteTable
VpcId:
Ref: VpcId
Outputs:
RouteTableId:
Description: The ID of the route table.
Value:
Fn::GetAtt:
- RouteTable
- RouteTableId
VpcId:
Description: The ID of the VRouter to which the route table belongs.
Value:
Fn::GetAtt:
- RouteTable
- VpcId
RouteTableType:
Description: The type of the route table.
Value:
Fn::GetAtt:
- RouteTable
- RouteTableType
VSwitchIds:
Description: A list of VSwitches under the VPC.
Value:
Fn::GetAtt:
- RouteTable
- VSwitchIds
RouteTableName:
Description: The name of the route table.
Value:
Fn::GetAtt:
- RouteTable
- RouteTableName {
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"RouteTableName": {
"Type": "String",
"Description": "The name of the route table.The name must be 2 to 128 characters in length. It can contain letters, numbers, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://."
},
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
}
},
"Resources": {
"RouteTable": {
"Type": "ALIYUN::VPC::RouteTable",
"Properties": {
"RouteTableName": "TestRouteTable",
"VpcId": {
"Ref": "VpcId"
}
}
}
},
"Outputs": {
"RouteTableId": {
"Description": "The ID of the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"RouteTableId"
]
}
},
"VpcId": {
"Description": "The ID of the VRouter to which the route table belongs.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"VpcId"
]
}
},
"RouteTableType": {
"Description": "The type of the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"RouteTableType"
]
}
},
"VSwitchIds": {
"Description": "A list of VSwitches under the VPC.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"VSwitchIds"
]
}
},
"RouteTableName": {
"Description": "The name of the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"RouteTableName"
]
}
}
}
}