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

语法

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

属性

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

返回值

Fn::GetAtt

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

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RouteTableId:
        Type: String
        Description: The ID of the route table.
      VSwitchId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Resources:
      RouteTableAssociation:
        Type: ALIYUN::VPC::RouteTableAssociation
        Properties:
          RouteTableId:
            Ref: RouteTableId
          VSwitchId:
            Ref: VSwitchId
    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            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RouteTableId": {
          "Type": "String",
          "Description": "The ID of the route table."
        },
        "VSwitchId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId"
        }
      },
      "Resources": {
        "RouteTableAssociation": {
          "Type": "ALIYUN::VPC::RouteTableAssociation",
          "Properties": {
            "RouteTableId": {
              "Ref": "RouteTableId"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            }
          }
        }
      },
      "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"
            ]
          }
        }
      }
    }