ALIYUN::VPC::RouteTableAttachment

更新时间:
复制为 MD 格式

ALIYUN::VPC::RouteTableAttachment类型用于将路由表和交换机绑定。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

RouteTableId

String

路由表ID。

VSwitchId

String

要绑定路由表的交换机ID。

返回值

Fn::GetAtt

  • RouteTableId:路由表ID。

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

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RouteTableId:
    Type: String
    Description:
      en: The ID of the route table.
    Required: true
  VSwitchId:
    Type: String
    Description:
      en: The ID of the VSwitch to bind the route table.
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      ZoneId: ${ZoneId}
      VpcId: ${VpcId}
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::VPC::RouteTableAttachment
    Properties:
      RouteTableId:
        Ref: RouteTableId
      VSwitchId:
        Ref: VSwitchId
Outputs:
  RouteTableId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RouteTableId
    Description: The ID of the route table.
  VSwitchId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - VSwitchId
    Description: The ID of the VSwitch to bind the route table.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RouteTableId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the route table."
      },
      "Required": true
    },
    "VSwitchId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the VSwitch to bind the route table."
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "ZoneId": "${ZoneId}",
        "VpcId": "${VpcId}"
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::VPC::RouteTableAttachment",
      "Properties": {
        "RouteTableId": {
          "Ref": "RouteTableId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        }
      }
    }
  },
  "Outputs": {
    "RouteTableId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RouteTableId"
        ]
      },
      "Description": "The ID of the route table."
    },
    "VSwitchId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "VSwitchId"
        ]
      },
      "Description": "The ID of the VSwitch to bind the route table."
    }
  }
}