ALIYUN::VPC::RouteTableAssociation

更新时间:
复制 MD 格式

Associates a custom route table with a vSwitch in the same VPC.

Syntax

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

Properties

Property name 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 attach. None.

Return values

Fn::GetAtt

  • RouteTableId: The ID of the route table.
  • VSwitchId: The ID of the attached vSwitch.

Examples

  • YAML format

    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 format

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