All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::Route

Last Updated:Jun 27, 2025

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

Allow updates

Description

Constraint

DestinationCidrBlock

String

Yes

No

The destination CIDR block of the custom route entry.

Supports IPv4, IPv6, prefix list destination CIDR blocks, and prefix list instance IDs. Make sure that the following requirements are met:

  • The destination CIDR block cannot point to 100.64.0.0/10 or belong to 100.64.0.0/10.

  • The destination CIDR blocks of the custom route entries in the same route table cannot overlap.

RouteTableId

String

Yes

No

The ID of the route table to which you want to add a custom route entry.

None

NextHopId

String

No

No

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

If you select Ecr for NextHopType, you can obtain the AssociationId as the next hop ID by calling the DescribeExpressConnectRouterAssociation operation.

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.

  • RouterInterface: router interface.

  • NetworkInterface: elastic network interface (ENI).

  • VpnGateway: VPN gateway.

  • IPv6Gateway: IPv6 gateway.

  • NatGateway: NAT gateway.

  • Attachment: transit router.

  • VpcPeer: VPC peering connection.

  • Ipv4Gateway: IPv4 gateway.

  • GatewayEndpoint: gateway endpoint.

  • Ecr: Express Connect router.

  • GatewayLoadBalancerEndpoint: Gateway Load Balancer endpoint.

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. The number of child items is less than or equal to 16.

For more information, see NextHopList properties.

DryRun

boolean

No

No

Specifies whether to perform only a dry run without performing the actual request.

Valid values:

  • true: Sends a check request without creating a route entry. The system checks the required parameters, request syntax, and limits. If the request fails the check, an error message is returned. If the request passes the check, the error code DryRunOperation is returned.

  • false (default): The system sends a normal request. If the request passes the validation, an HTTP 2xx status code is returned and the operation is performed.

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

Weight

integer<int32>

No

No

The routing weight of the next hop of the ECMP route.

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

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  ECSRoute:
    Type: ALIYUN::ECS::Route
    Properties:
      RouteTableId: vtb-25oud****
      DestinationCidrBlock: 172.16.XX.XX/24
      NextHopId: i-25xzy****
{
  "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 information, see the combined example of assigning an IPv6 address to an elastic network interface and creating a custom route entry: YAML example.