Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_lb in non availability zone regions errors. #12756

Closed
georgegil opened this issue Jul 27, 2021 · 2 comments
Closed

azurerm_lb in non availability zone regions errors. #12756

georgegil opened this issue Jul 27, 2021 · 2 comments

Comments

@georgegil
Copy link

georgegil commented Jul 27, 2021

Community Note

  • Please vote on this issue by adding a 👍 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 (and AzureRM Provider) Version

terraform version 1.0.2
provider version 2.68.0

Affected Resource(s)

  • azurerm_azurerm_lb

Terraform Configuration Files

resource "azurerm_lb" "lb" {
  name                = "auseazddns"
  location            = "Australia Southeast"
  resource_group_name = "Networking-Transit"
  sku                 = "Standard"
  
  frontend_ip_configuration {
    name                          = "auseazddns"
    subnet_id                     = "/subscriptions/xxx-xx-xx-xxx-xxxx/resourceGroups/Networking-Transit/providers/Microsoft.Network/virtualNetworks/auseprod-transit-vnet/subnets/PlatformServicesSubnet"
    private_ip_address_allocation = "Dynamic"
  }

}

Debug Output

PUT /subscriptions/xxxxxxxxx/resourceGroups/Networking-DNS-Service/providers/Microsoft.Network/loadBalancers/auseazddns?api-version=2020-11-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.16.3 (amd64-linux) go-autorest/v14.2.1 Azure-SDK-For-Go/v55.5.0 network/2020-11-01 HashiCorp Terraform/1.0.2 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azurerm/2.68.0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 440
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: ff296b43-63e9-b427-e25f-80006c301e3d
Accept-Encoding: gzip

{"location":"australiasoutheast","properties":{"frontendIPConfigurations":[{"name":"auseazddns","properties":{"privateIPAddressVersion":"IPv4","privateIPAllocationMethod":"Dynamic","subnet":{"id":"/subscriptions/xxxxxxxxxxxx/resourceGroups/Networking-Transit/providers/Microsoft.Network/virtualNetworks/auseprod-transit-vnet/subnets/PlatformServicesSubnet"}},"zones":["1","2"]}]},"sku":{"name":"Standard"},"tags":{}}: timestamp=2021-07-27T13:45:50.112Z

Panic Output

│ Error: creating/updating Load Balancer "auseazddns" (Resource Group "Networking-DNS-Service"): network.LoadBalancersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="SubscriptionDoesNotSupportZone" Message="Cannot create/move resource /subscriptions/xxxxxx/resourceGroups/Networking-DNS-Service/providers/Microsoft.Network/loadBalancers/auseazddns/frontendIPConfigurations/auseazddns which uses zone 1 since subscription xxxxxxxxxx does not support zone 1 in location australiasoutheast." Details=[]
│ 
│   with module.ause_dns.azurerm_lb.lb,
│   on vmss-module/main.tf line 6, in resource "azurerm_lb" "lb":
│    6: resource "azurerm_lb" "lb" {
│ 

Expected Behaviour

A load balancer should have been created with no zone information.

Actual Behaviour

It failed with the error that the australiasoutheast does not support zone 1

Evident from the PUT shown above, it is attempting to define zone information, when it should not.

Steps to Reproduce

Create a standard load balancer in australiasoutheast

  1. terraform apply

Important Factoids

References

@tombuildsstuff
Copy link
Contributor

hi @georgegil

Thanks for opening this issue - apologies for the delayed response here.

As a part of the upcoming v3.0 of the Azure Provider we're looking to make both the identity and zone/zones blocks consistent across the Provider, which is being tracked in #14588.

The specific changes to these blocks can be found in the 3.0 Upgrade Guide but in short we'll be moving towards:

  1. Where a single Availability Zone is available (either Required/Optional), the field will be zone (highlighting that only a single Availability Zone can be configured).
  2. Where multiple Availability Zones can be configured (either Required or where Optional [for Zoneless]) - the field zones will be used.
    • To deploy a resource into all Zones, each of the Zones will need to be specified (e.g. zones = ["1", "2", "3"])
    • To deploy a resource into a single Zone, the single Zone should be specified (e.g. zones = ["1"])
    • To deploy a resource Zoneless, the zones field should be omitted.

This functionality is coming in version 3.0 of the Azure Provider and can be used today by enabling the 3.0 Beta available within v2.97.0 of the AzureRM Provider. Specific instructions on how to opt-into this can be found in the 3.0 Beta Guide - but this'll be enabled by default when v3.0 of the AzureRM Provider ships.

Rather than having multiple issues open tracking the same thing, as #14588 is tracking making zones consistent across the Provider, I'm going to close this issue in favour of that one - would you mind subscribing to #14588 for updates?

Thanks!

@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants