ALIYUN::VPC::RouteTableAssociation is used to associate a custom routing table with a VSwitch in the same VPC.

Syntax

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

Properties

Name Type Required Editable Description Validity
RouteTableId String Yes No The ID of the routing table. None
VSwitchId String Yes No The ID of the VSwitch with which the routing table will be associated. None

Response parameters

Fn::GetAtt

  • RouteTableId: the ID of the routing table.
  • VSwitchId: the ID of the VSwitch.

Examples

JSON format

{
  "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 format

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