hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.52k stars 4.6k forks source link

Support for Virtual Hubs additional properties (virtualRouterAsn / hubRoutingPreference / allowBranchToBranchTraffic) #18802

Open vmisson opened 1 year ago

vmisson commented 1 year ago

Is there an existing issue for this?

Community Note

Description

Some properties are not available on azurerm_virtual_hub ressource creation :

New or Affected Resource(s)/Data Source(s)

azurerm_virtual_hub

Potential Terraform Configuration

resource "azurerm_virtual_hub" "example" {
  name                           = "example-virtualhub"
  resource_group_name            = azurerm_resource_group.example.name
  location                       = azurerm_resource_group.example.location
  virtual_wan_id                 = azurerm_virtual_wan.example.id
  address_prefix                 = "10.0.0.0/23"
  virtual_router_asn             = "65001"
  hub_routing_preference         = "ASPath"
  allow_branch_to_branch_traffic = "true"
}

References

https://learn.microsoft.com/en-us/rest/api/virtualwan/virtual-hubs/create-or-update?tabs=HTTP https://learn.microsoft.com/en-us/azure/virtual-wan/about-virtual-hub-routing-preference

neil-yechenwei commented 1 year ago

Thanks for raising this issue. For allowBranchToBranchTraffic, seems it has been implemented by azurerm_route_server.

vmisson commented 1 year ago

Hi @neil-yechenwei, yes I agree with you, you can managed the allowBranchToBranchTraffic in standalone Route Server but you cannot use this for a managed Route Server in vWAN.

vladimir-setka-form3 commented 1 year ago

Why not add all missing properties? At least all the basic ones should be there. For my use-case, I need to be able to set virtualRouterAutoScaleConfiguration in order to increase the minimum routing unit capacity.

osten33 commented 1 year ago

Agree that all should be there but it's harder to get someone to pick up adding the support for it if its just a request for "all". Since this hasn't gotten any attention since mid Oct I wonder if it would make sense to split up the request to smaller, I'm very much interested in getting the routing preference feature implemented. Side question, is it possible to set a custom ASN on the vHUB? My understanding was that it always has to be 65515.

menamartin commented 1 year ago

Any solution for hub_routing_preference ? By default Azure configures the option as "Expressroute" and we need it as "aspath"

LaurentLesle commented 1 year ago

Bumping in this ask to put it on top of the pile and also asking to add the routing infrastructure units as well

resource "azurerm_virtual_hub" "example" {
  name                           = "example-virtualhub"
  resource_group_name            = azurerm_resource_group.example.name
  location                       = azurerm_resource_group.example.location
  virtual_wan_id                 = azurerm_virtual_wan.example.id
  address_prefix                 = "10.0.0.0/23"
  virtual_router_asn             = 65001
  hub_routing_preference         = "ASPath"
  allow_branch_to_branch_traffic = true
  min_capacity                   = 5 # number between 2 and 50

}

To bring parity to the portal experience.

image

Also tried using azapi_update_resource to change to

image

FreddyAyala commented 1 year ago

Have same issue, need to set virtual hub capacity using Terraform code, for the moment this is not possible.

FreddyAyala commented 1 year ago

Bumping in this ask to put it on top of the pile and also asking to add the routing infrastructure units as well

resource "azurerm_virtual_hub" "example" {
  name                           = "example-virtualhub"
  resource_group_name            = azurerm_resource_group.example.name
  location                       = azurerm_resource_group.example.location
  virtual_wan_id                 = azurerm_virtual_wan.example.id
  address_prefix                 = "10.0.0.0/23"
  virtual_router_asn             = 65001
  hub_routing_preference         = "ASPath"
  allow_branch_to_branch_traffic = true
  min_capacity                   = 5 # number between 2 and 50

}

To bring parity to the portal experience. image

Also tried using azapi_update_resource to change to

  • ASPath: working
  • minCapacity: not working (tried with quotes and non-quoted)

image

Could you share your workaround using AzAPI to test from my side? Thanks

JordanSussman commented 9 months ago

I was able to update the virtual hub capacity with the following azapi_update_resource config:

resource "azapi_update_resource" "hub_min_capacity" {
  type        = "Microsoft.Network/virtualHubs@2023-05-01"
  resource_id = azurerm_virtual_hub.hub.id

  body = jsonencode({
    properties = {
      "virtualRouterAutoScaleConfiguration" : {
        "minCapacity" : 3
      }
    }
  })

  depends_on = [
    azurerm_virtual_hub.hub,
  ]
}
fgloureiro222 commented 1 week ago

Bumping in this to asking to add the routing infrastructure units as well. Required feature that is missing.

Thanks