Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions internal/services/network/express_route_gateway_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ func resourceExpressRouteGateway() *pluginsdk.Resource {
ValidateFunc: validation.IntBetween(1, 10),
},

"allow_none_virtual_wan_traffic": {
Type: pluginsdk.TypeBool,
Optional: true,
Default: false,
},

"tags": tags.Schema(),
},
}
Expand Down Expand Up @@ -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_none_virtual_wan_traffic").(bool)),
AutoScaleConfiguration: &network.ExpressRouteGatewayPropertiesAutoScaleConfiguration{
Bounds: &network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{
Min: &minScaleUnits,
Expand Down Expand Up @@ -168,6 +175,7 @@ func resourceExpressRouteGatewayRead(d *pluginsdk.ResourceData, meta interface{}
virtualHubId = *props.VirtualHub.ID
}
d.Set("virtual_hub_id", virtualHubId)
d.Set("allow_none_virtual_wan_traffic", props.AllowNonVirtualWanTraffic)

scaleUnits := 0
if props.AutoScaleConfiguration != nil && props.AutoScaleConfiguration.Bounds != nil && props.AutoScaleConfiguration.Bounds.Min != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_none_virtual_wan_traffic = true

tags = {
Hello = "World"
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/express_route_gateway.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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_none_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
Expand Down