ALIYUN::VPC::RouteTable类型用于创建一个自定义路由表。

目前不支持在以下地域创建路由表:
  • 华北2(北京)
  • 华南1(深圳)
  • 华东1(杭州)

语法

{
  "Type": "ALIYUN::VPC::RouteTable",
  "Properties": {
    "RouteTableName": String,
    "VpcId": String,
    "Description": String,
    "Tags": List
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
VpcId String 自定义路由表所属的VPC ID
RouteTableName String 路由表的名称 长度为2~128个字符,可包含数字、英文句点(.)、下划线(_)和短横线(-)。必须以字母或中文开头,不能以http://https://开头。
Description String 路由表的描述信息 长度为2~256个字符。必须以字母或中文开头,不能以http://https://开头。
Tags List 标签,例如:[{"Key": "RTTag", "Value": ""}] 最多设置20个标签,每个标签由键值对组成。标签值可以为空。

返回值

Fn::GetAtt

  • RouteTableId:路由表ID。
  • VpcId:自定义路由表所属的VPC ID。
  • RouteTableName:路由表的名称。
  • RouteTableType:路由表的类型。
  • VSwitchIds:VPC下的交换机列表。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "RouteTable": {
      "Type": "ALIYUN::VPC::RouteTable",
      "Properties": {
        "RouteTableName": {
          "Ref": "RouteTableName"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "Description": {
          "Ref": "Description"
        }
      }
    }
  },
  "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",
      "Description": "The ID of the VPC to which the custom route table belongs."
    },
    "Description": {
      "Type": "String",
      "Description": "The description of the route table.The description must be 2 to 256 characters in length and start with a letter, but cannot be start with http:// or https://."
    }
  },
  "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"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  RouteTable:
    Type: ALIYUN::VPC::RouteTable
    Properties:
      RouteTableName:
        Ref: RouteTableName
      VpcId:
        Ref: VpcId
      Description:
        Ref: Description
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
    Description: The ID of the VPC to which the custom route table belongs.
  Description:
    Type: String
    Description: The description of the route table.The description must be 2 to 256
      characters in length and start with a letter, but cannot be start with http://
      or https://.
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