HashiCorp Terraform resource that can create an Azure Route Server with the Branch-to-Branch feature enabled

I do not see a native module for the Azure Route Server itself and see the virtual hub resource is close but I don’t see an option to enable the Branch-to-Branch functionality in the virtual hub resource. I was previously using Terraform to just push an ARM Template but seem to run into issues with destroying it later. I thought it would be best to try and use a native Terraform resource instead.

My current solution is to use the virtual hub resource then follow up with pushing an Azure CLI command like so:

resource "null_resource" "branch_to_branch" { provisioner "local-exec" { command = "az network routeserver update --name ${var.base_rs_name} --resource-group ${azurerm_resource_group.rg.name} --allow-b2b-traffic true" } }

That also seems a bit less than elegant and want to see if there is a better approach.

References

Here is a link to the Microsoft virtualHub template documentation ([Microsoft.Network/virtualHubs - Bicep & ARM template reference | Microsoft Docs]) .

Here is a link to the Azure CLI documentation ([az network routeserver | Microsoft Docs]) for the Microsoft Route Server showing the “allow-b2b-traffic {false, true}” setting I am talking about.