diff --git a/internal/services/network/express_route_gateway_resource.go b/internal/services/network/express_route_gateway_resource.go index ac2f8486b628..01db29de8833 100644 --- a/internal/services/network/express_route_gateway_resource.go +++ b/internal/services/network/express_route_gateway_resource.go @@ -63,6 +63,12 @@ func resourceExpressRouteGateway() *pluginsdk.Resource { ValidateFunc: validation.IntBetween(1, 10), }, + "allow_non_virtual_wan_traffic": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + "tags": tags.Schema(), }, } @@ -110,6 +116,7 @@ func resourceExpressRouteGatewayCreateUpdate(d *pluginsdk.ResourceData, meta int parameters := network.ExpressRouteGateway{ Location: utils.String(location), ExpressRouteGatewayProperties: &network.ExpressRouteGatewayProperties{ + AllowNonVirtualWanTraffic: utils.Bool(d.Get("allow_non_virtual_wan_traffic").(bool)), AutoScaleConfiguration: &network.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ Bounds: &network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ Min: &minScaleUnits, @@ -168,6 +175,7 @@ func resourceExpressRouteGatewayRead(d *pluginsdk.ResourceData, meta interface{} virtualHubId = *props.VirtualHub.ID } d.Set("virtual_hub_id", virtualHubId) + d.Set("allow_non_virtual_wan_traffic", props.AllowNonVirtualWanTraffic) scaleUnits := 0 if props.AutoScaleConfiguration != nil && props.AutoScaleConfiguration.Bounds != nil && props.AutoScaleConfiguration.Bounds.Min != nil { diff --git a/internal/services/network/express_route_gateway_resource_test.go b/internal/services/network/express_route_gateway_resource_test.go index d2a6faa511d1..4644ffe019f4 100644 --- a/internal/services/network/express_route_gateway_resource_test.go +++ b/internal/services/network/express_route_gateway_resource_test.go @@ -111,11 +111,12 @@ func (r ExpressRouteGatewayResource) complete(data acceptance.TestData, scaleUni %s resource "azurerm_express_route_gateway" "test" { - name = "acctestER-gateway-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - virtual_hub_id = azurerm_virtual_hub.test.id - scale_units = %d + name = "acctestER-gateway-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = %d + allow_non_virtual_wan_traffic = true tags = { Hello = "World" diff --git a/website/docs/r/express_route_gateway.html.markdown b/website/docs/r/express_route_gateway.html.markdown index b5b55e20950b..cfe641591875 100644 --- a/website/docs/r/express_route_gateway.html.markdown +++ b/website/docs/r/express_route_gateway.html.markdown @@ -59,6 +59,8 @@ The following arguments are supported: * `scale_units` - (Required) The number of scale units with which to provision the ExpressRoute gateway. Each scale unit is equal to 2Gbps, with support for up to 10 scale units (20Gbps). +* `allow_non_virtual_wan_traffic` - (Optional) Specified whether this gateway accept traffic from non-Virtual WAN networks. Defaults to `false`. + * `tags` - (Optional) A mapping of tags to assign to the resource. ## Attributes Reference