diff --git a/internal/services/network/application_gateway_resource.go b/internal/services/network/application_gateway_resource.go index 0028ec225f34..4610dd292248 100644 --- a/internal/services/network/application_gateway_resource.go +++ b/internal/services/network/application_gateway_resource.go @@ -811,6 +811,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ + string(applicationgateways.ApplicationGatewaySkuNameBasic), string(applicationgateways.ApplicationGatewaySkuNameStandardSmall), string(applicationgateways.ApplicationGatewaySkuNameStandardMedium), string(applicationgateways.ApplicationGatewaySkuNameStandardLarge), @@ -825,6 +826,7 @@ func resourceApplicationGateway() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ + string(applicationgateways.ApplicationGatewayTierBasic), string(applicationgateways.ApplicationGatewayTierStandard), string(applicationgateways.ApplicationGatewayTierStandardVTwo), string(applicationgateways.ApplicationGatewayTierWAF), @@ -4709,12 +4711,45 @@ func checkSslPolicy(sslPolicy []interface{}) error { return nil } +func checkBasicSkuFeatures(d *pluginsdk.ResourceDiff) error { + _, hasAutoscaleConfig := d.GetOk("autoscale_configuration.0") + if hasAutoscaleConfig { + return fmt.Errorf("The Application Gateway does not support `autoscale_configuration` blocks for the selected SKU tier %q", applicationgateways.ApplicationGatewaySkuNameBasic) + } + + capacity, hasCapacityConfig := d.GetOk("sku.0.capacity") + if hasCapacityConfig { + if capacity.(int) > 2 || capacity.(int) < 1 { + return fmt.Errorf("`capacity` value %q for the selected SKU tier %q is invalid. Value must be between [1-2]", capacity, applicationgateways.ApplicationGatewaySkuNameBasic) + } + } else { + return fmt.Errorf("The Application Gateway must specify a `capacity` value between [1-2] for the selected SKU tier %q", applicationgateways.ApplicationGatewaySkuNameBasic) + } + + _, hasMtlsConfig := d.GetOk("trusted_client_certificate") + if hasMtlsConfig { + return fmt.Errorf("The Application Gateway does not support `trusted_client_certificate` blocks for the selected SKU tier %q", applicationgateways.ApplicationGatewaySkuNameBasic) + } + + _, hasRewriteRuleSetConfig := d.GetOk("rewrite_rule_set") + if hasRewriteRuleSetConfig { + return fmt.Errorf("The Application Gateway does not support `rewrite_rule_set` blocks for the selected SKU tier %q", applicationgateways.ApplicationGatewaySkuNameBasic) + } + + return nil +} + func applicationGatewayCustomizeDiff(ctx context.Context, d *pluginsdk.ResourceDiff, _ interface{}) error { _, hasAutoscaleConfig := d.GetOk("autoscale_configuration.0") capacity, hasCapacity := d.GetOk("sku.0.capacity") tier := d.Get("sku.0.tier").(string) - if !hasAutoscaleConfig && !hasCapacity { + if tier == string(applicationgateways.ApplicationGatewaySkuNameBasic) { + err := checkBasicSkuFeatures(d) + if err != nil { + return err + } + } else if !hasAutoscaleConfig && !hasCapacity { return fmt.Errorf("The Application Gateway must specify either `capacity` or `autoscale_configuration` for the selected SKU tier %q", tier) } diff --git a/internal/services/network/application_gateway_resource_test.go b/internal/services/network/application_gateway_resource_test.go index 0ee0de00fb24..33d843fff58b 100644 --- a/internal/services/network/application_gateway_resource_test.go +++ b/internal/services/network/application_gateway_resource_test.go @@ -32,8 +32,8 @@ func TestAccApplicationGateway_basic(t *testing.T) { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku.0.name").HasValue("Standard_Small"), - check.That(data.ResourceName).Key("sku.0.tier").HasValue("Standard"), + check.That(data.ResourceName).Key("sku.0.name").HasValue("Standard_v2"), + check.That(data.ResourceName).Key("sku.0.tier").HasValue("Standard_v2"), check.That(data.ResourceName).Key("sku.0.capacity").HasValue("2"), check.That(data.ResourceName).Key("waf_configuration.#").HasValue("0"), ), @@ -713,8 +713,8 @@ func TestAccApplicationGateway_webApplicationFirewall(t *testing.T) { Config: r.webApplicationFirewall(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku.0.name").HasValue("WAF_Medium"), - check.That(data.ResourceName).Key("sku.0.tier").HasValue("WAF"), + check.That(data.ResourceName).Key("sku.0.name").HasValue("WAF_v2"), + check.That(data.ResourceName).Key("sku.0.tier").HasValue("WAF_v2"), check.That(data.ResourceName).Key("sku.0.capacity").HasValue("1"), check.That(data.ResourceName).Key("waf_configuration.0.enabled").HasValue("true"), check.That(data.ResourceName).Key("waf_configuration.0.firewall_mode").HasValue("Detection"), @@ -745,8 +745,8 @@ func TestAccApplicationGateway_connectionDraining(t *testing.T) { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("sku.0.name").HasValue("Standard_Small"), - check.That(data.ResourceName).Key("sku.0.tier").HasValue("Standard"), + check.That(data.ResourceName).Key("sku.0.name").HasValue("Standard_v2"), + check.That(data.ResourceName).Key("sku.0.tier").HasValue("Standard_v2"), check.That(data.ResourceName).Key("sku.0.capacity").HasValue("2"), check.That(data.ResourceName).Key("waf_configuration.#").HasValue("0"), acceptance.TestCheckNoResourceAttr(data.ResourceName, "backend_http_settings.0.connection_draining.0.enabled"), @@ -1320,6 +1320,24 @@ func TestAccApplicationGateway_removeFirewallPolicy(t *testing.T) { }) } +func TestAccApplicationGateway_basicSku(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_application_gateway", "test") + r := ApplicationGatewayResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic_basicSku(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("sku.0.name").HasValue("Basic"), + check.That(data.ResourceName).Key("sku.0.tier").HasValue("Basic"), + check.That(data.ResourceName).Key("sku.0.capacity").IsNotEmpty(), + ), + }, + data.ImportStep(), + }) +} + func (t ApplicationGatewayResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := applicationgateways.ParseApplicationGatewayID(state.ID) if err != nil { @@ -1354,8 +1372,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -1399,6 +1417,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -1584,6 +1603,85 @@ resource "azurerm_application_gateway" "test" { `, r.template(data), data.RandomInteger, data.RandomInteger) } +func (r ApplicationGatewayResource) basic_basicSku(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +# since these variables are re-used - a locals block makes this more maintainable +locals { + backend_address_pool_name = "${azurerm_virtual_network.test.name}-beap" + frontend_port_name = "${azurerm_virtual_network.test.name}-feport" + frontend_ip_configuration_name = "${azurerm_virtual_network.test.name}-feip" + http_setting_name = "${azurerm_virtual_network.test.name}-be-htst" + listener_name = "${azurerm_virtual_network.test.name}-httplstn" + request_routing_rule_name = "${azurerm_virtual_network.test.name}-rqrt" +} + +resource "azurerm_public_ip" "test_standard" { + name = "acctest-pubip-standard" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + +resource "azurerm_application_gateway" "test" { + name = "acctestag-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + sku { + name = "Basic" + tier = "Basic" + capacity = 2 + } + + gateway_ip_configuration { + name = "my-gateway-ip-configuration" + subnet_id = azurerm_subnet.test.id + } + + frontend_port { + name = local.frontend_port_name + port = 80 + } + + frontend_ip_configuration { + name = local.frontend_ip_configuration_name + public_ip_address_id = azurerm_public_ip.test_standard.id + } + + backend_address_pool { + name = local.backend_address_pool_name + } + + backend_http_settings { + name = local.http_setting_name + cookie_based_affinity = "Disabled" + port = 80 + protocol = "Http" + request_timeout = 1 + } + + http_listener { + name = local.listener_name + frontend_ip_configuration_name = local.frontend_ip_configuration_name + frontend_port_name = local.frontend_port_name + protocol = "Http" + } + + request_routing_rule { + name = local.request_routing_rule_name + priority = 100 + rule_type = "Basic" + http_listener_name = local.listener_name + backend_address_pool_name = local.backend_address_pool_name + backend_http_settings_name = local.http_setting_name + } +} +`, r.template(data), data.RandomInteger) +} + func (r ApplicationGatewayResource) createGlobalConfiguration(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -2109,8 +2207,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -2155,6 +2253,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -2181,8 +2280,8 @@ resource "azurerm_application_gateway" "test" { enable_http2 = true sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -2226,6 +2325,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -2241,8 +2341,8 @@ resource "azurerm_application_gateway" "import" { location = azurerm_application_gateway.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -2286,6 +2386,7 @@ resource "azurerm_application_gateway" "import" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.basic(data)) @@ -2312,8 +2413,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -2366,6 +2467,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -2737,8 +2839,8 @@ resource "azurerm_application_gateway" "test" { force_firewall_policy_association = %t sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -2782,6 +2884,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger, forceFirewallPolicyAssociation) @@ -3266,8 +3369,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -3320,6 +3423,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -3445,8 +3549,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -3489,6 +3593,7 @@ resource "azurerm_application_gateway" "test" { rule_type = "PathBasedRouting" url_path_map_name = local.url_path_map_name http_listener_name = local.listener_name + priority = 10 } url_path_map { @@ -3533,8 +3638,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -3577,6 +3682,7 @@ resource "azurerm_application_gateway" "test" { rule_type = "PathBasedRouting" url_path_map_name = local.url_path_map_name http_listener_name = local.listener_name + priority = 10 } redirect_configuration { @@ -3630,8 +3736,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -3688,6 +3794,7 @@ resource "azurerm_application_gateway" "test" { rule_type = "Basic" http_listener_name = local.listener_name redirect_configuration_name = local.redirect_configuration_name + priority = 10 } redirect_configuration { @@ -3726,8 +3833,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -3783,6 +3890,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name redirect_configuration_name = local.redirect_configuration_name + priority = 10 } redirect_configuration { @@ -3824,8 +3932,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -3880,6 +3988,7 @@ resource "azurerm_application_gateway" "test" { rule_type = "PathBasedRouting" url_path_map_name = local.url_path_map_name http_listener_name = local.listener_name + priority = 10 } url_path_map { @@ -3946,8 +4055,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4022,6 +4131,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -4049,8 +4159,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4128,6 +4238,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -4154,8 +4265,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4211,6 +4322,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -4328,8 +4440,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4375,6 +4487,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger, hostName, pick) @@ -4481,8 +4594,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4527,6 +4640,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -4873,8 +4987,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4919,6 +5033,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } ssl_certificate { @@ -4951,8 +5066,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -4997,6 +5112,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } ssl_certificate { @@ -5029,8 +5145,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -5075,6 +5191,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } ssl_certificate { @@ -5158,8 +5275,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -5203,6 +5320,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } ssl_certificate { @@ -5241,8 +5359,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -5286,6 +5404,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } ssl_certificate { @@ -5323,8 +5442,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "WAF_Medium" - tier = "WAF" + name = "WAF_v2" + tier = "WAF_v2" capacity = 1 } @@ -5378,6 +5497,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -5404,8 +5524,8 @@ resource "azurerm_application_gateway" "test" { enable_http2 = true sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -5454,6 +5574,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -6234,8 +6355,8 @@ resource "azurerm_public_ip" "test" { name = "acctest-pubip-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name - allocation_method = "Dynamic" - sku = "Basic" + allocation_method = "Static" + sku = "Standard" } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) } @@ -6262,8 +6383,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -6327,6 +6448,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -6904,8 +7026,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -6950,6 +7072,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -6975,8 +7098,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -7020,6 +7143,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -7052,8 +7176,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -7097,6 +7221,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger, data.RandomInteger) @@ -7209,8 +7334,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -7265,6 +7390,7 @@ resource "azurerm_application_gateway" "test" { rule_type = "PathBasedRouting" url_path_map_name = local.url_path_map_name http_listener_name = local.listener_name + priority = 10 } url_path_map { @@ -7330,8 +7456,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -7376,6 +7502,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -8125,8 +8252,8 @@ resource "azurerm_application_gateway" "test" { fips_enabled = %t sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -8170,6 +8297,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger, enableFips) @@ -8196,8 +8324,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -8248,6 +8376,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -8274,8 +8403,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -8321,6 +8450,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) @@ -8346,8 +8476,8 @@ resource "azurerm_application_gateway" "test" { location = azurerm_resource_group.test.location sku { - name = "Standard_Small" - tier = "Standard" + name = "Standard_v2" + tier = "Standard_v2" capacity = 2 } @@ -8390,6 +8520,7 @@ resource "azurerm_application_gateway" "test" { http_listener_name = local.listener_name backend_address_pool_name = local.backend_address_pool_name backend_http_settings_name = local.http_setting_name + priority = 10 } } `, r.template(data), data.RandomInteger) diff --git a/website/docs/r/application_gateway.html.markdown b/website/docs/r/application_gateway.html.markdown index 4a28c064cb07..d6505ea9b701 100644 --- a/website/docs/r/application_gateway.html.markdown +++ b/website/docs/r/application_gateway.html.markdown @@ -184,7 +184,7 @@ The following arguments are supported: * `autoscale_configuration` - (Optional) An `autoscale_configuration` block as defined below. -* `rewrite_rule_set` - (Optional) One or more `rewrite_rule_set` blocks as defined below. Only valid for v2 SKUs. +* `rewrite_rule_set` - (Optional) One or more `rewrite_rule_set` blocks as defined below. Only valid for v2 WAF and Standard SKUs. --- @@ -402,7 +402,7 @@ A `probe` block supports the following: * `unhealthy_threshold` - (Required) The Unhealthy Threshold for this Probe, which indicates the amount of retries which should be attempted before a node is deemed unhealthy. Possible values are from 1 to 20. -* `port` - (Optional) Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from HTTP settings will be used. This property is valid for Standard_v2 and WAF_v2 only. +* `port` - (Optional) Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from HTTP settings will be used. This property is valid for Basic, Standard_v2 and WAF_v2 only. * `pick_host_name_from_backend_http_settings` - (Optional) Whether the host header should be picked from the backend HTTP settings. Defaults to `false`. @@ -448,13 +448,13 @@ A `global` block supports the following: A `sku` block supports the following: -* `name` - (Required) The Name of the SKU to use for this Application Gateway. Possible values are `Standard_Small`, `Standard_Medium`, `Standard_Large`, `Standard_v2`, `WAF_Medium`, `WAF_Large`, and `WAF_v2`. +* `name` - (Required) The Name of the SKU to use for this Application Gateway. Possible values are `Basic`, `Standard_Small`, `Standard_Medium`, `Standard_Large`, `Basic`, `Standard_v2`, `WAF_Medium`, `WAF_Large`, and `WAF_v2`. -* `tier` - (Required) The Tier of the SKU to use for this Application Gateway. Possible values are `Standard`, `Standard_v2`, `WAF` and `WAF_v2`. +* `tier` - (Required) The Tier of the SKU to use for this Application Gateway. Possible values are `Basic`, `Standard`, `Standard_v2`, `WAF` and `WAF_v2`. -!> **NOTE:** The `Standard` and `WAF` SKU have been deprecated in favour of the `Standard_v2` and `WAF_v2` SKU. Please see the [Azure documentation](https://aka.ms/V1retirement) for more details. +!> **NOTE:** The `Standard` and `WAF` SKU have been deprecated in favour of the `Basic`, `Standard_v2` and `WAF_v2` SKU. Please see the [Azure documentation](https://aka.ms/V1retirement) for more details. -* `capacity` - (Optional) The Capacity of the SKU to use for this Application Gateway. When using a V1 SKU this value must be between `1` and `32`, and `1` to `125` for a V2 SKU. This property is optional if `autoscale_configuration` is set. +* `capacity` - (Optional) The Capacity of the SKU to use for this Application Gateway. When using a V1 SKU this value must be between `1` and `32`, and `1` to `125` for a V2 SKU. When using a `Basic` SKU this property must be between `1` and `2`. This property is optional if `autoscale_configuration` is set. ---