From 8b46c963d0e4a02365018133ba1bbe6fa2a969f4 Mon Sep 17 00:00:00 2001 From: Miltos Tsatsakis Date: Thu, 21 Mar 2024 11:24:06 +0200 Subject: [PATCH] feat(connectivity): Add option to set allow_non_virtual_wan_traffic in express route gateway. --- README.md | 1 + ...amples]-Deploy-Virtual-WAN-Resources-With-Custom-Settings.md | 1 + modules/connectivity/locals.tf | 1 + modules/connectivity/variables.tf | 1 + resources.virtual_wan.tf | 2 +- tests/modules/settings/settings.connectivity.tf | 1 + variables.tf | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9507eedf..b3c570d1c 100644 --- a/README.md +++ b/README.md @@ -450,6 +450,7 @@ object({ enabled = optional(bool, false) config = optional(object({ scale_unit = optional(number, 1) + allow_non_virtual_wan_traffic = optional(bool, false) }), {}) }), {}) vpn_gateway = optional(object({ diff --git a/docs/wiki/[Examples]-Deploy-Virtual-WAN-Resources-With-Custom-Settings.md b/docs/wiki/[Examples]-Deploy-Virtual-WAN-Resources-With-Custom-Settings.md index 64460d6e5..88a9f61a2 100644 --- a/docs/wiki/[Examples]-Deploy-Virtual-WAN-Resources-With-Custom-Settings.md +++ b/docs/wiki/[Examples]-Deploy-Virtual-WAN-Resources-With-Custom-Settings.md @@ -180,6 +180,7 @@ locals { enabled = true config = { scale_unit = 1 + allow_non_virtual_wan_traffic = false } } vpn_gateway = { diff --git a/modules/connectivity/locals.tf b/modules/connectivity/locals.tf index 7a4e9eeec..69738ba58 100644 --- a/modules/connectivity/locals.tf +++ b/modules/connectivity/locals.tf @@ -1343,6 +1343,7 @@ locals { location = location virtual_hub_id = local.virtual_hub_resource_id[location] scale_units = virtual_hub.config.expressroute_gateway.config.scale_unit + allow_non_virtual_wan_traffic = virtual_hub.config.expressroute_gateway.config.allow_non_virtual_wan_traffic # Optional definition attributes tags = try(local.custom_settings.azurerm_express_route_gateway["virtual_wan"][location].tags, local.tags) } diff --git a/modules/connectivity/variables.tf b/modules/connectivity/variables.tf index e31e4f976..394cd265d 100644 --- a/modules/connectivity/variables.tf +++ b/modules/connectivity/variables.tf @@ -166,6 +166,7 @@ variable "settings" { enabled = optional(bool, false) config = optional(object({ scale_unit = optional(number, 1) + allow_non_virtual_wan_traffic = optional(bool, false) }), {}) }), {}) vpn_gateway = optional(object({ diff --git a/resources.virtual_wan.tf b/resources.virtual_wan.tf index 9aceec5b5..f206fb471 100644 --- a/resources.virtual_wan.tf +++ b/resources.virtual_wan.tf @@ -80,7 +80,7 @@ resource "azurerm_express_route_gateway" "virtual_wan" { location = each.value.template.location virtual_hub_id = each.value.template.virtual_hub_id scale_units = each.value.template.scale_units - + allow_non_virtual_wan_traffic = each.value.template.allow_non_virtual_wan_traffic # Optional resource attributes tags = each.value.template.tags diff --git a/tests/modules/settings/settings.connectivity.tf b/tests/modules/settings/settings.connectivity.tf index 935133ef3..320a7d4f3 100644 --- a/tests/modules/settings/settings.connectivity.tf +++ b/tests/modules/settings/settings.connectivity.tf @@ -143,6 +143,7 @@ locals { enabled = true config = { scale_unit = 1 + allow_non_virtual_wan_traffic = false } } vpn_gateway = { diff --git a/variables.tf b/variables.tf index 01febda8f..d4afb45b2 100644 --- a/variables.tf +++ b/variables.tf @@ -279,6 +279,7 @@ variable "configure_connectivity_resources" { enabled = optional(bool, false) config = optional(object({ scale_unit = optional(number, 1) + allow_non_virtual_wan_traffic = optional(bool, false) }), {}) }), {}) vpn_gateway = optional(object({