Support of Route Server

Looking to check if Route Server ( What is Azure Route Server (Preview)? | Microsoft Docs ) is supported by HCL

3 Likes

Does anyone have an answer to this? I Don’t want to build an entire vWAN resource just to provision one Route Server. As far as I can tell there is no Route Server component to the terraform offering of the vwan or virtual hub product?

Any pointers gratefully received

1 Like

I believe it is named a bit different as a Virtual Hub, could that be?

Example of the resource:

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_virtual_hub" "example" {
  name                = "example-vhub"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  sku                 = "Standard"
}

resource "azurerm_public_ip" "example" {
  name                = "example-pip"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  allocation_method   = "Dynamic"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-vnet"
  address_space       = ["10.5.0.0/16"]
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_subnet" "example" {
  name                 = "RouteServerSubnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefix       = "10.5.1.0/24"
}

resource "azurerm_virtual_hub_ip" "example" {
  name                         = "example-vhubipconfig"
  virtual_hub_id               = azurerm_virtual_hub.example.id
  private_ip_address           = "10.5.1.18"
  private_ip_allocation_method = "Static"
  public_ip_address_id         = azurerm_public_ip.example.id
  subnet_id                    = azurerm_subnet.example.id
}

Example including BGP Connection:

// https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub_bgp_connection
resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_virtual_hub" "example" {
  name                = "example-vhub"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  sku                 = "Standard"
}

resource "azurerm_public_ip" "example" {
  name                = "example-pip"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  allocation_method   = "Dynamic"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-vnet"
  address_space       = ["10.5.0.0/16"]
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_subnet" "example" {
  name                 = "RouteServerSubnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefix       = "10.5.1.0/24"
}

resource "azurerm_virtual_hub_ip" "example" {
  name                         = "example-vhubip"
  virtual_hub_id               = azurerm_virtual_hub.example.id
  private_ip_address           = "10.5.1.18"
  private_ip_allocation_method = "Static"
  public_ip_address_id         = azurerm_public_ip.example.id
  subnet_id                    = azurerm_subnet.example.id
}

resource "azurerm_virtual_hub_bgp_connection" "example" {
  name           = "example-vhub-bgpconnection"
  virtual_hub_id = azurerm_virtual_hub.example.id
  peer_asn       = 65514
  peer_ip        = "169.254.21.5"

  depends_on = [azurerm_virtual_hub_ip.example]
}

Thanks that’s mostly worked for me. I had to use static allocation method for my public IP and with that a standard sku but other than that was exactly what I was looking for.

Many thanks!

1 Like