Route Tables

Overview

The routeTable builder creates a route table to efficiently change default routing traffic between Azure subnets, virtual networks, and on-premises networks. To learn more about routeTables, reference the Azure Docs

  • RouteTable (Microsoft.Network/routeTables)
  • Route (Microsoft.Network/routeTables/routes)

Builder Keywords

Applies ToKeywordPurpose
routeTablenameName of the NAT Gateway resource
routeTabledisableBgpRoutePropagationWhether to disable the routes learned by BGP on that route table
routeTableadd_routesThe routes to be added to this route table
routenameName of the route resource
routeaddressPrefixThe destination CIDR to which the route applies
routenextHopTypeThe type of Azure hop the packet should be sent to
routenextHopIpAddressThe IP address packets should be forwarded to. Only allowed in routes where the next hop type is VirtualAppliance
routehasBgpOverrideWhether the route overrides overlapping BGP routes regardless of LPM

Example

#r "nuget:Farmer"

open Farmer
open Farmer.Builders

arm {
    location Location.EastUS

    add_resources
        [
            routeTable {
                name "myroutetable"

                add_routes
                    [
                        route {
                            name "myroute"
                            addressPrefix "10.10.90.0/24"
                            nextHopIpAddress "10.10.67.5"
                        }
                        route {
                            name "myroute2"
                            addressPrefix "10.10.80.0/24"
                        }
                        route {
                            name "myroute3"
                            addressPrefix "10.2.31.0/24"
                            nextHopType (Route.HopType.VirtualAppliance None)
                        }
                        route {
                            name "myroute4"
                            addressPrefix "10.2.31.0/24"

                            nextHopType (
                                Route.HopType.VirtualAppliance(
                                    Some(System.Net.IPAddress.Parse "10.2.31.2")
                                )
                            )
                        }
                    ]
            }
        ]
}