ALIYUN::VPC::RouteTableWithGatewayAssociation

Updated at: 2025-02-28 08:47

ALIYUN::VPC::RouteTableWithGatewayAssociation is used to associate a gateway route table with an IPv4 or IPv6 gateway in the same virtual private cloud (VPC).

Syntax

{
  "Type": "ALIYUN::VPC::RouteTableWithGatewayAssociation",
  "Properties": {
    "GatewayType": String,
    "GatewayId": String,
    "RouteTableId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Property

Type

Required

Editable

Description

Constraint

GatewayType

String

Yes

No

The type of the gateway.

Set the value to Ipv4Gateway.

GatewayId

String

Yes

No

The ID of the IPv4 gateway.

None.

RouteTableId

String

Yes

No

The ID of the gateway route table.

None.

Return values

Fn::GetAtt

  • RouteTableId: the ID of the gateway route table.

  • GatewayId: the ID of the gateway.

Examples

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RouteTableId:
    Type: String
    Description:
      en: The ID of route table that gateway is to be bound.
    Required: true
  GatewayType:
    Type: String
    Description:
      en: Types of the associated gateway instance.
    AllowedValues:
      - Ipv4Gateway
    Required: true
  GatewayId:
    Type: String
    Description:
      en: |-
        The ID of the IPv4 gateway that is to be associated.
        The IPv4 gateway instance must be activated.
    Required: true
Resources:
  RouteTableWithGatewayAssociation:
    Type: ALIYUN::VPC::RouteTableWithGatewayAssociation
    Properties:
      RouteTableId:
        Ref: RouteTableId
      GatewayType:
        Ref: GatewayType
      GatewayId:
        Ref: GatewayId
Outputs:
  RouteTableId:
    Description: The ID of route table that gateway is to be bound.
    Value:
      Fn::GetAtt:
        - RouteTableWithGatewayAssociation
        - RouteTableId
  GatewayId:
    Description: The ID of the IPv4 gateway that is to be associated.
    Value:
      Fn::GetAtt:
        - RouteTableWithGatewayAssociation
        - GatewayId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RouteTableId": {
      "Type": "String",
      "Description": {
        "en": "The ID of route table that gateway is to be bound."
      },
      "Required": true
    },
    "GatewayType": {
      "Type": "String",
      "Description": {
        "en": "Types of the associated gateway instance."
      },
      "AllowedValues": [
        "Ipv4Gateway"
      ],
      "Required": true
    },
    "GatewayId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the IPv4 gateway that is to be associated.\nThe IPv4 gateway instance must be activated."
      },
      "Required": true
    }
  },
  "Resources": {
    "RouteTableWithGatewayAssociation": {
      "Type": "ALIYUN::VPC::RouteTableWithGatewayAssociation",
      "Properties": {
        "RouteTableId": {
          "Ref": "RouteTableId"
        },
        "GatewayType": {
          "Ref": "GatewayType"
        },
        "GatewayId": {
          "Ref": "GatewayId"
        }
      }
    }
  },
  "Outputs": {
    "RouteTableId": {
      "Description": "The ID of route table that gateway is to be bound.",
      "Value": {
        "Fn::GetAtt": [
          "RouteTableWithGatewayAssociation",
          "RouteTableId"
        ]
      }
    },
    "GatewayId": {
      "Description": "The ID of the IPv4 gateway that is to be associated.",
      "Value": {
        "Fn::GetAtt": [
          "RouteTableWithGatewayAssociation",
          "GatewayId"
        ]
      }
    }
  }
}
                        
  • On this page (1)
  • Syntax
  • Properties
  • Return values
  • Examples
Feedback