All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::RouteTableAttachment

更新時間:Jul 05, 2026

The ALIYUN::VPC::RouteTableAttachment resource associates a route table with a VSwitch.

Syntax

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

Properties

Parameter

Type

Required

Update allowed

Description

Constraints

RouteTableId

String

Yes

No

The ID of the route table.

None

VSwitchId

String

Yes

No

The ID of the VSwitch to be associated with the route table.

None

Return values

Use the Fn::GetAtt intrinsic function to retrieve the values of the following attributes:

  • RouteTableId: The ID of the route table.

  • VSwitchId: The ID of the VSwitch associated with the route table.

Examples

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 be associated with 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 associated with 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 be associated with 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 associated with the route table."
    }
  }
}