ALIYUN::VPC::RouteTableAssociation类型用于绑定创建的自定义路由表和同一VPC内的交换机。

语法

{
  "Type": "ALIYUN::VPC::RouteTableAssociation",
  "Properties": {
    "RouteTableId": String,
    "VSwitchId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
RouteTableId String 路由表ID。 无。
VSwitchId String 要绑定的交换机ID。 无。

返回值

Fn::GetAtt

  • RouteTableId:路由表ID。
  • VSwitchId:要绑定的交换机ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "RouteTableAssociation": {
      "Type": "ALIYUN::VPC::RouteTableAssociation",
      "Properties": {
        "RouteTableId": {
          "Ref": "RouteTableId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        }
      }
    }
  },
  "Parameters": {
    "RouteTableId": {
      "Type": "String",
      "Description": "The ID of the route table."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of the VSwitch."
    }
  },
  "Outputs": {
    "RouteTableId": {
      "Description": "The ID of the route table.",
      "Value": {
        "Fn::GetAtt": [
          "RouteTableAssociation",
          "RouteTableId"
        ]
      }
    },
    "VSwitchId": {
      "Description": "The VSwitch ID which the route table associated with.",
      "Value": {
        "Fn::GetAtt": [
          "RouteTableAssociation",
          "VSwitchId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  RouteTableAssociation:
    Type: ALIYUN::VPC::RouteTableAssociation
    Properties:
      RouteTableId:
        Ref: RouteTableId
      VSwitchId:
        Ref: VSwitchId
Parameters:
  RouteTableId:
    Type: String
    Description: The ID of the route table.
  VSwitchId:
    Type: String
    Description: The ID of the VSwitch.
Outputs:
  RouteTableId:
    Description: The ID of the route table.
    Value:
      Fn::GetAtt:
      - RouteTableAssociation
      - RouteTableId
  VSwitchId:
    Description: The VSwitch ID which the route table associated with.
    Value:
      Fn::GetAtt:
      - RouteTableAssociation
      - VSwitchId