This template deploys a Route Server into a subnet named RouteServerSubnet.
{"condition": "[equals(parameters('vnetnew_or_existing'), "new')]", "type": "microsoft.network/virtualnetworks", "apiversion": "2020-05-01", "name": "[parameters('vnetname')]", "location": "[parameters('location')]", "properties": {"addressspace": {"addressprefixes": ["[parameters('vnetipprefix')]"]}}}{"type": "microsoft.network/virtualnetworks/subnets", "apiversion": "2020-05-01", "name": "[format('{0}/{1}", parameters('vnetname'), variables('routeserversubnetname'))]", "properties": {"addressprefix": "[parameters('routeserversubnetipprefix')]"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('vnetname'))]"]}{"condition": "[equals(parameters('publicipnew_or_existing'), "new')]", "type": "microsoft.network/publicipaddresses", "apiversion": "2020-05-01", "name": "[parameters('publicipname')]", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {"publicipallocationmethod": "static", "publicipaddressversion": "ipv4", "idletimeoutinminutes": 4}}{"type": "microsoft.network/virtualhubs", "apiversion": "2020-06-01", "name": "[parameters('firstrouteservername')]", "location": "[parameters('location')]", "properties": {"sku": "standard"}}{"type": "microsoft.network/virtualhubs/ipconfigurations", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('firstrouteservername'), variables('ipconfigname'))]", "properties": {"subnet": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), variables('routeserversubnetname'))]"}, "publicipaddress": {"id": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]"}}, "dependson": ["[resourceid('microsoft.network/virtualhubs", parameters('firstrouteservername'))]", "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), variables('routeserversubnetname'))]"]}{"type": "microsoft.network/virtualhubs/bgpconnections", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('firstrouteservername'), parameters('routeserverbgpconnectionname'))]", "properties": {"peerasn": "[parameters('peerasn')]", "peerip": "[parameters('peerip')]"}, "dependson": ["[resourceid('microsoft.network/virtualhubs", parameters('firstrouteservername'))]", "[resourceid('microsoft.network/virtualhubs/ipconfigurations", parameters('firstrouteservername'), variables('ipconfigname'))]"]} 