Skip to content

Commit d04338b

Browse files
authored
azurerm_virtual_network_gateway: add support for ErGwScale in sku (#31082)
[ENHANCEMENT] * `azurerm_virtual_network_gateway` - add support for the `ErGwScale` SKU
1 parent f4103e5 commit d04338b

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

internal/services/network/virtual_network_gateway_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ func validateVirtualNetworkGatewayExpressRouteSku() pluginsdk.SchemaValidateFunc
15491549
string(virtualnetworkgateways.VirtualNetworkGatewaySkuNameErGwOneAZ),
15501550
string(virtualnetworkgateways.VirtualNetworkGatewaySkuNameErGwTwoAZ),
15511551
string(virtualnetworkgateways.VirtualNetworkGatewaySkuNameErGwThreeAZ),
1552+
string(virtualnetworkgateways.VirtualNetworkGatewaySkuNameErGwScale),
15521553
}, false)
15531554
}
15541555

internal/services/network/virtual_network_gateway_resource_test.go

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,23 @@ func TestAccVirtualNetworkGateway_expressRoute(t *testing.T) {
309309
})
310310
}
311311

312+
func TestAccVirtualNetworkGateway_expressRouteErGwScale(t *testing.T) {
313+
data := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway", "test")
314+
r := VirtualNetworkGatewayResource{}
315+
data.ResourceTest(t, r, []acceptance.TestStep{
316+
{
317+
Config: r.expressRouteErGwScale(data),
318+
Check: acceptance.ComposeTestCheckFunc(
319+
check.That(data.ResourceName).ExistsInAzure(r),
320+
check.That(data.ResourceName).Key("type").HasValue("ExpressRoute"),
321+
check.That(data.ResourceName).Key("sku").HasValue("ErGwScale"),
322+
check.That(data.ResourceName).Key("bgp_settings.#").HasValue("0"),
323+
),
324+
},
325+
data.ImportStep(),
326+
})
327+
}
328+
312329
func TestAccVirtualNetworkGateway_customRoute(t *testing.T) {
313330
data := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway", "test")
314331
r := VirtualNetworkGatewayResource{}
@@ -1306,6 +1323,48 @@ resource "azurerm_virtual_network_gateway" "test" {
13061323
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger)
13071324
}
13081325

1326+
func (VirtualNetworkGatewayResource) expressRouteErGwScale(data acceptance.TestData) string {
1327+
return fmt.Sprintf(`
1328+
provider "azurerm" {
1329+
features {}
1330+
}
1331+
1332+
resource "azurerm_resource_group" "test" {
1333+
name = "acctestRG-%d"
1334+
location = "%s"
1335+
}
1336+
1337+
resource "azurerm_virtual_network" "test" {
1338+
name = "acctestvn-%d"
1339+
location = azurerm_resource_group.test.location
1340+
resource_group_name = azurerm_resource_group.test.name
1341+
address_space = ["10.0.0.0/16"]
1342+
}
1343+
1344+
resource "azurerm_subnet" "test" {
1345+
name = "GatewaySubnet"
1346+
resource_group_name = azurerm_resource_group.test.name
1347+
virtual_network_name = azurerm_virtual_network.test.name
1348+
address_prefixes = ["10.0.1.0/24"]
1349+
}
1350+
1351+
resource "azurerm_virtual_network_gateway" "test" {
1352+
name = "acctestvng-%d"
1353+
location = azurerm_resource_group.test.location
1354+
resource_group_name = azurerm_resource_group.test.name
1355+
1356+
type = "ExpressRoute"
1357+
vpn_type = "PolicyBased"
1358+
sku = "ErGwScale"
1359+
1360+
ip_configuration {
1361+
private_ip_address_allocation = "Dynamic"
1362+
subnet_id = azurerm_subnet.test.id
1363+
}
1364+
}
1365+
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger)
1366+
}
1367+
13091368
func (VirtualNetworkGatewayResource) generation(data acceptance.TestData, generation string) string {
13101369
return fmt.Sprintf(`
13111370
provider "azurerm" {

website/docs/r/virtual_network_gateway.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The following arguments are supported:
112112

113113
* `resource_group_name` - (Required) The name of the resource group in which to create the Virtual Network Gateway. Changing this forces a new resource to be created.
114114

115-
* `sku` - (Required) Configuration of the size and capacity of the virtual network gateway. Valid options are `Basic`, `Standard`, `HighPerformance`, `UltraPerformance`, `ErGw1AZ`, `ErGw2AZ`, `ErGw3AZ`, `VpnGw1`, `VpnGw2`, `VpnGw3`, `VpnGw4`,`VpnGw5`, `VpnGw1AZ`, `VpnGw2AZ`, `VpnGw3AZ`,`VpnGw4AZ` and `VpnGw5AZ` and depend on the `type`, `vpn_type` and `generation` arguments. A `PolicyBased` gateway only supports the `Basic` SKU. Further, the `UltraPerformance` SKU is only supported by an `ExpressRoute` gateway.
115+
* `sku` - (Required) Configuration of the size and capacity of the virtual network gateway. Valid options are `Basic`, `Standard`, `HighPerformance`, `UltraPerformance`, `ErGwScale`, `ErGw1AZ`, `ErGw2AZ`, `ErGw3AZ`, `VpnGw1`, `VpnGw2`, `VpnGw3`, `VpnGw4`,`VpnGw5`, `VpnGw1AZ`, `VpnGw2AZ`, `VpnGw3AZ`,`VpnGw4AZ` and `VpnGw5AZ` and depend on the `type`, `vpn_type` and `generation` arguments. A `PolicyBased` gateway only supports the `Basic` SKU. Further, the `UltraPerformance` and `ErGwScale` SKU is only supported by an `ExpressRoute` gateway.
116116

117117
~> **Note:** To build a UltraPerformance ExpressRoute Virtual Network gateway, the associated Public IP needs to be SKU "Basic" not "Standard"
118118

0 commit comments

Comments
 (0)