All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::Route

最終更新日:Dec 08, 2023

ALIYUN::ECS::Route is used to create a custom route entry.

Syntax

{
  "Type": "ALIYUN::ECS::Route",
  "Properties": {
    "DestinationCidrBlock": String,
    "RouteTableId": String,
    "NextHopId": String,
    "NextHopType": String,
    "NextHopList": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DestinationCidrBlock

String

Yes

No

The destination CIDR block of the custom route entry.

None.

RouteTableId

String

Yes

No

The ID of the route table.

None.

NextHopId

String

No

No

The ID of the next-hop instance of the custom route entry.

None.

NextHopType

String

No

No

The type of the next hop of the custom route entry.

Valid values:

  • Instance (default): Elastic Compute Service (ECS) instance

  • HaVip: high-availability virtual IP address (HAVIP)

  • RouterInterface: router interface

  • NetworkInterface: elastic network interface (ENI)

  • VpnGateway: VPN gateway

  • IPv6Gateway: IPv6 gateway

  • NatGateway: NAT gateway

  • Attachment: transit router

NextHopList

List

No

No

The next hops of the custom route entry.

If NextHopList is specified, the route entry is an equal-cost multi-path (ECMP) route entry.

Valid values: 2 to 4.

For more information, see NextHopList properties.

NextHopList syntax

"NextHopList": [
  {
    "NextHopId": String,
    "NextHopType": String
  }
]

NextHopList properties

Property

Type

Required

Editable

Description

Constraint

NextHopId

String

Yes

No

The ID of the next-hop instance of the ECMP route entry.

None.

NextHopType

String

No

No

The type of the next hop of the ECMP route entry.

Set the value to RouterInterface.

Return values

Fn::GetAtt

RouteEntryId: the ID of the custom route entry.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Resources:
      ECSRoute:
        Type: ALIYUN::ECS::Route
        Properties:
          RouteTableId: vtb-25oud****
          DestinationCidrBlock: 172.16.XX.XX/24
          NextHopId: i-25xzy****
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Resources": {
        "ECSRoute": {
          "Type": "ALIYUN::ECS::Route",
          "Properties": {
            "RouteTableId": "vtb-25oud****",
            "DestinationCidrBlock": "172.16.XX.XX/24",
            "NextHopId": "i-25xzy****"
          }
        }
      }
    }

For more examples, visit Route.json and Route.yml. In the examples, the ALIYUN::ECS::AssignIpv6Addresses and ALIYUN::ECS::Route resource types are used.