aztfmod / terraform-provider-azurecaf

Terraform provider for the Terraform platform engineering for Azure
MIT License
176 stars 94 forks source link

SubscriptionDoesNotSupportZone when creating Load Balancer FrontEndIPConfiguration in a non-Availability Zone region #217

Open mikecuison opened 1 year ago

mikecuison commented 1 year ago

I am trying to create a Load Balancer with FrontEndIPConfiguration resource in the West Central US region, which currently does not offer Availability Zone feature and no matter what "zone" value I specify (Null, "No-Zone", [], omitting the zone property...) on the frontend_ip_configurations code block, the TF apply fails with the below error.

│ Error: creating/updating Load Balancer: (Name "lb-ilb-wcus-001" / Resource Group "rg-network"): network.LoadBalancersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="SubscriptionDoesNotSupportZone" Message="Cannot create/move resource /subscriptions//resourceGroups/rg-network/providers/Microsoft.Network/loadBalancers/lb-ilb-wcus-001/frontendIPConfigurations/frontend-ilb-config1-wcus which uses zone 1 since subscription does not support zone 1 in location westcentralus." Details=[] │ │ with module.caf.module.load_balancers["lb1_region1"].azurerm_lb.lb, │ on .terraform\modules\caf\modules\networking\load_balancers\load_balancers.tf line 11, in resource "azurerm_lb" "lb": │ 11: resource "azurerm_lb" "lb" {

I am using the latest version of the aztzmod/caf/azurerm module v5.6.4.

Terraform Configuration:

global_settings = {
  default_region = "region1"
  regions = {
    region1 = "westcentralus"
  }
  passthrough   = false
  random_length = 0
  prefixes      = []
  suffixes      = []
  use_slug      = true
}

# Create Resource Groups
resource_groups = {
  rg_network = {
    name = "network"
  }
}

vnets = {
  vnet_fw_region1 = {
    resource_group_key = "rg_network"
    region             = "region1"
    vnet = {
      name          = "hub-wcus-01"
      address_space = ["10.218.2.0/23"]
    }
    specialsubnets = {}
    subnets = {
      snet_trusted = {
        name = "trusted"
        cidr = ["10.218.2.0/27"]
      }
    }
  }
}

load_balancers = {
  lb1_region1 = {
    name                      = "ilb-wcus-001"
    sku                       = "Standard" 
    resource_group_key        = "rg_network"
    region                    = "region1"
    backend_address_pool_name = "backend-ilb"
    availability_zone         = "No-Zone"

    frontend_ip_configurations = {
      feip_lb1_config1_region1 = {
        name                          = "frontend-ilb-config1-wcus"
        vnet_key                      = "vnet_fw_region1"
        subnet_key                    = "snet_trusted"
        private_ip_address_allocation = "dynamic"
        availability_zone             = "No-Zone"
        zones                              = null
      }
    }
  }
}