terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

application_gateway failed to create with Standard sku

Open thllxb opened this issue 3 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.2.1

AzureRM Provider Version

3.10.0

Affected Resource(s)/Data Source(s)

azurerm_application_gateway

Terraform Configuration Files

resource "azurerm_application_gateway" "appgw" {
  name                = local.name
  resource_group_name = azurerm_resource_group.rg.name
  location            = azurerm_resource_group.rg.location

  sku {
    name     = "Standard_Small"
    tier     = "Standard"
    capacity = 1
  }
  backend_address_pool {
    name = "default"
  }
  backend_http_settings {
    cookie_based_affinity = "Disabled"
    name                  = "default"
    port                  = 80
    protocol              = "Http"
  }
  frontend_ip_configuration {
    name = "default"
  }
  frontend_port {
    name = "default"
    port = 80
  }
  gateway_ip_configuration {
    name      = "default"
    subnet_id = azurerm_subnet.subnet.id
  }
  http_listener {
    frontend_ip_configuration_name = "default"
    frontend_port_name             = "default"
    name                           = "default"
    protocol                       = "Http"
  }
  request_routing_rule {
    backend_http_settings_name = "default"
    http_listener_name         = "default"
    name                       = "default"
    rule_type                  = "Basic"
    priority                   = 1
  }
}

Debug Output/Panic Output

https://gist.github.com/thllxb/fbef2dd4561a564fbfd12812d1e09071

Expected Behaviour

AppGW gets created successfully

Actual Behaviour

Error: creating Application Gateway: (Name "benny-test" / Resource Group "benny-test"): network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Erro r: Code="ApplicationGatewayFeatureCannotBeEnabledForSelectedSku" Message="Application Gateway /subscriptions/60f1d817-6efb-4f9e-9569-47fbcf078573/resourceGroups/benny-test/providers/Microsoft.Netw ork/applicationGateways/benny-test/requestRoutingRules/default does not support Priority for the selected SKU tier Standard. Supported SKU tiers are Standard_v2,WAF_v2." Details=[]

Steps to Reproduce

No response

Important Factoids

Removing request_routing_rule.0.priority is not an option now as it has become a required field.

References

It is related to this change https://github.com/hashicorp/terraform-provider-azurerm/issues/16793

thllxb avatar Jun 10 '22 18:06 thllxb

Ok so it looks like priority is used differently in various SKUs

Standard_Small, Standard_Medium, Standard_Large, WAF_Medium, WAF_Large - Priority isn't a thing Standard_v2 and WAF_v2 - Priority is mandatory as of API version 2021-08-01

@tombuildsstuff @mbfrahry what's the preferred approach here? Remove Priority as mandatory to fix this issue, and leave it up to the underlying Azure APIs to return an error if Priority is missing in the v2 SKUs?

bubbletroubles avatar Jun 14 '22 20:06 bubbletroubles

Having the same issue as well. We are using Standard_Medium and it's failing.

Agree with @bubbletroubles, 'Priority' shouldn't be made mandatory because clearly v1 tiers does not support it. Hoping a fix can be added for this soon.

yohaansunnie avatar Jun 24 '22 13:06 yohaansunnie

I have the same Issue. I hope this could be fixed soon too.

tschmitt-imcts avatar Jun 26 '22 08:06 tschmitt-imcts

Pr #17830 has been submitted to fix this

bubbletroubles avatar Jun 26 '22 09:06 bubbletroubles

This was fixed in PR #17380 and released in v3.13.0 of the Terraform Provider - I believe it can now be closed.

@tombuildsstuff FYI I don't think it needs to be tracked in the milestones each week.

bubbletroubles avatar Jul 28 '22 11:07 bubbletroubles

Fixed in v3.13.0

tombuildsstuff avatar Oct 11 '22 19:10 tombuildsstuff

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Nov 11 '22 02:11 github-actions[bot]