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

NameTypeRequiredEditableDescriptionValidity
RouteTableIdStringYesNoThe ID of the routing table.None
VSwitchIdStringYesNoThe 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

  • YAMLformat

    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            
  • JSONformat

    {
      "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"
            ]
          }
        }
      }
    }