Skip to content

Commit

Permalink
feat(connectivity): Add option to set allow_non_virtual_wan_traffic i…
Browse files Browse the repository at this point in the history
…n express route gateway. (#914)

Co-authored-by: Miltos Tsatsakis <[email protected]>
  • Loading branch information
Slapper and Miltos Tsatsakis authored Apr 5, 2024
1 parent e6cb214 commit fc666d1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ locals {
enabled = true
config = {
scale_unit = 1
allow_non_virtual_wan_traffic = false
}
}
vpn_gateway = {
Expand Down
11 changes: 6 additions & 5 deletions modules/connectivity/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1338,11 +1338,12 @@ locals {
resource_id = local.virtual_hub_express_route_gateway_resource_id[location]
managed_by_module = local.deploy_virtual_hub_express_route_gateway[location]
# Resource definition attributes
name = local.virtual_hub_express_route_gateway_name[location]
resource_group_name = local.virtual_hub_resource_group_name[location]
location = location
virtual_hub_id = local.virtual_hub_resource_id[location]
scale_units = virtual_hub.config.expressroute_gateway.config.scale_unit
name = local.virtual_hub_express_route_gateway_name[location]
resource_group_name = local.virtual_hub_resource_group_name[location]
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)
}
Expand Down
3 changes: 2 additions & 1 deletion modules/connectivity/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ variable "settings" {
expressroute_gateway = optional(object({
enabled = optional(bool, false)
config = optional(object({
scale_unit = optional(number, 1)
scale_unit = optional(number, 1)
allow_non_virtual_wan_traffic = optional(bool, false)
}), {})
}), {})
vpn_gateway = optional(object({
Expand Down
12 changes: 6 additions & 6 deletions resources.virtual_wan.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ resource "azurerm_express_route_gateway" "virtual_wan" {
provider = azurerm.connectivity

# Mandatory resource attributes
name = each.value.template.name
resource_group_name = each.value.template.resource_group_name
location = each.value.template.location
virtual_hub_id = each.value.template.virtual_hub_id
scale_units = each.value.template.scale_units

name = each.value.template.name
resource_group_name = each.value.template.resource_group_name
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

Expand Down
3 changes: 2 additions & 1 deletion tests/modules/settings/settings.connectivity.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ locals {
expressroute_gateway = {
enabled = true
config = {
scale_unit = 1
scale_unit = 1
allow_non_virtual_wan_traffic = false
}
}
vpn_gateway = {
Expand Down
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ variable "configure_connectivity_resources" {
expressroute_gateway = optional(object({
enabled = optional(bool, false)
config = optional(object({
scale_unit = optional(number, 1)
scale_unit = optional(number, 1)
allow_non_virtual_wan_traffic = optional(bool, false)
}), {})
}), {})
vpn_gateway = optional(object({
Expand Down

0 comments on commit fc666d1

Please sign in to comment.