Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meraki_networks_appliance_vpn_site_to_site_vpn, impossible to put more than one hub #188

Open
Fran-E opened this issue Dec 12, 2024 · 2 comments

Comments

@Fran-E
Copy link

Fran-E commented Dec 12, 2024

Is your feature request related to a problem? Please describe.
In the ressource meraki_networks_appliance_vpn_site_to_site_vpn it's impossible to put more than one hub.

Describe the solution you'd like
The value hubs need to accept more than one hub.

Describe alternatives you've considered
Normally priority have to be manage but this is not clearly managed in the official API

Thanks in advance for your help.

Br,

@finkjordanj
Copy link

If its just having multiple hubs in this resource, you are able to do this already. Just requires them as a list of objects, you can do this for the same as you do for the vlans.

I pass this var into my resource. The locals is where i did a lookup of the hubs to get their network_id

network_hubs = [
    { hub_id = local.this_hub_1.id, use_default_route = true },
    { hub_id = local.this_hub_2.id, use_default_route = true }
  ]

If its a concern on the ordering you can set a lifecycle to ignore the hubs

locals {
  # Build the subnets list based on var.vlans
  vpn_subnets = [for vlan in var.vlans : {
    local_subnet = vlan.subnet
    use_vpn      = vlan.vpn_enable
  }]
}

resource "meraki_networks_appliance_vpn_site_to_site_vpn" "this_vpn_vlan" {
  network_id = [for item in meraki_networks_appliance_vlans.this_vlan : item.network_id][0]
  mode       = "spoke"
  hubs       = var.network_hubs
  subnets    = local.vpn_subnets

  lifecycle {
    ignore_changes = [hubs]
  }
}

@Fran-E
Copy link
Author

Fran-E commented Dec 12, 2024

Hello,

Thank you very much for your support. I confirm I can push 2 hubs, it was mistake from my side.

About ordering, I don't understand how this will help me, perhaps here this is somethink I dont't really understand from the dashboard.

Br,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants