azurerm / terraform-azure-locations

Terraform module to provide Azure location information.
https://registry.terraform.io/modules/azurerm/locations/azure/latest
MIT License
0 stars 0 forks source link

Azurerm resource group was not found in the list of supported Azure Locations #4

Open jfneely opened 11 months ago

jfneely commented 11 months ago

When running terraform plan for a dev environment I'm trying to set up I keep getting this error message:

Error: "azurerm_resource_group.mtc-rg.location" was not found in the list of supported Azure Locations:

"australiacentral,australiacentral2,australiaeast,australiasoutheast,brazilsouth,brazilsoutheast,brazilus,canadacentral,canadaeast,centralindia,centralus,centraluseuap,eastasia,eastus,eastus2,eastus2euap,francecentral,francesouth,germanynorth,germanywestcentral,israelcentral,italynorth,japaneast,japanwest,jioindiacentral,jioindiawest,koreacentral,koreasouth,malaysiasouth,northcentralus,northeurope,norwayeast,norwaywest,polandcentral,qatarcentral,southafricanorth,southafricawest,southcentralus,southeastasia,southindia,swedencentral,swedensouth,switzerlandnorth,switzerlandwest,uaecentral,uaenorth,uksouth,ukwest,westcentralus,westeurope,westindia,westus,westus2,westus3,austriaeast,chilecentral,eastusslv,israelnorthwest,malaysiawest,mexicocentral,newzealandnorth,southeastasiafoundational,spaincentral,taiwannorth,taiwannorthwest" │ │ with azurerm_virtual_network.mtc-vn, │ on main.tf line 25, in resource "azurerm_virtual_network" "mtc-vn": │ 25: location = "azurerm_resource_group.mtc-rg.location"

Terraform.io version: 3.0.0 Code:

terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "=3.0.0" } } }

provider "azurerm" { features {} }

resource "azurerm_resource_group" "mtc-rg" { name = "mtc-resources" location = "East Us" tags = { environment = "dev" } }

resource "azurerm_virtual_network" "mtc-vn" { name = "mtc-network" resource_group_name = "azurerm_resource_group.mtc-rg.name" location = "azurerm_resource_group.mtc-rg.location" address_space = ["10.123.0.0/16"]

tags = { environment = "dev" } }

It seems like the execution is getting hung up on the location line. I really appreciate help to solve this issue. Thank you in advance.

vmisson commented 11 months ago

Hello @jfneely,

I think the correct code must be : `terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "=3.0.0" } } }

provider "azurerm" { features {} }

resource "azurerm_resource_group" "mtc-rg" { name = "mtc-resources" location = "East Us" tags = { environment = "dev" } }

resource "azurerm_virtual_network" "mtc-vn" { name = "mtc-network" resource_group_name = azurerm_resource_group.mtc-rg.name location = azurerm_resource_group.mtc-rg.location address_space = ["10.123.0.0/16"]

tags = { environment = "dev" } }`

can you please try this and let me know ? Have a good day.

jfneely commented 11 months ago

I pasted what you sent in that took care of it minus the ` symbol at the beginning and end. I tried looking at what you sent and what I had, but couldn't see anything different. Can you please point out what had changed with the code you sent? Thank you.

On Wed, Oct 11, 2023 at 12:22 AM Vincent Misson @.***> wrote:

Hello @jfneely https://github.com/jfneely,

I think the correct code must be : `terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "=3.0.0" } } }

provider "azurerm" { features {} }

resource "azurerm_resource_group" "mtc-rg" { name = "mtc-resources" location = "East Us" tags = { environment = "dev" } }

resource "azurerm_virtual_network" "mtc-vn" { name = "mtc-network" resource_group_name = azurerm_resource_group.mtc-rg.name location = azurerm_resource_group.mtc-rg.location address_space = ["10.123.0.0/16"]

tags = { environment = "dev" } }`

can you please try this and let me know ? Have a good day.

— Reply to this email directly, view it on GitHub https://github.com/azurerm/terraform-azure-locations/issues/4#issuecomment-1757006221, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDF7ZK4QZAWT2QNJXUPCZVDX6ZCK7ANCNFSM6AAAAAA53OFEQ4 . You are receiving this because you were mentioned.Message ID: @.***>