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 for the custom route entry. None
NextHopType String No No The type of the next hop. Default value: Instance. Valid values:
  • Instance: an Elastic Compute Service (ECS) instance
  • HaVip: a high-availability virtual IP address (HAVIP)
  • RouterInterface: a router interface
  • NetworkInterface: an elastic network interface (ENI)
  • VpnGateway: a VPN gateway
  • IPv6Gateway: an IPv6 gateway
  • NatGateway: a NAT gateway
  • Attachment: a transit router
NextHopList List No No The list of next hops of the custom route entry. If you set the NextHopList property, the route entry is an equal-cost multipath (ECMP) route.

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 for the ECMP route entry. None
NextHopType String No No The type of the next hop for the ECMP route entry. Set the value to RouterInterface.

Return values

Fn::GetAtt

None

Examples

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

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