Terraform v0.12.20
+ provider.azurerm v2.20.0
For example RG resource, but everything else fails. RG is only the prerequisite
provider "azurerm" {
version = "~> 2"
tenant_id = var.tenant_id
subscription_id = var.subscription_id
features {}
}
resource "azurerm_resource_group" "resource_group" {
name = var.resource_group_name
location = var.resource_group_location
tags = var.tags
}
Terraform should create resources in desired location/region
Terraform does not support the south/west/central India locations. They are called India south/west/central in terraform which is not valid on Azure site
https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/internal/location/validation_test.go#L167
If we set location/region name to Terraform format (validation above), we got an error originating from Azure
Error: Error creating Resource Group "<SOME_RG>": resources.GroupsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="LocationNotAvailableForResourceGroup" Message="The provided location 'indiasouth' is not available for resource group. List of available regions is 'centralus,eastasia,southeastasia,eastus,eastus2,westus,westus2,northcentralus,southcentralus,westcentralus,northeurope,westeurope,japaneast,japanwest,brazilsouth,australiasoutheast,australiaeast,westindia,southindia,centralindia,canadacentral,canadaeast,uksouth,ukwest,koreacentral,koreasouth,francecentral,southafricanorth,uaenorth,australiacentral,switzerlandnorth,germanywestcentral,norwayeast'."
on 10-main.tf line 8, in resource "azurerm_resource_group" "resource_group":
8: resource "azurerm_resource_group" "resource_group" {
Which is reasonable and expected since
08:44 $ az account list-locations -o table
DisplayName Latitude Longitude Name
-------------------- ---------- ----------- ------------------
...
South India 12.9822 80.1636 southindia
Central India 18.5822 73.9197 centralindia
West India 19.088 72.868 westindia
...
But trying to use the valid location/region on Azure fails in Terraform validation
Error: "southindia" was not found in the list of supported Azure Locations: "westus,westus2,eastus,centralus,centraluseuap,southcentralus,northcentralus,westcentralus,eastus2,eastus2euap,brazilsouth,brazilus,northeurope,westeurope,eastasia,southeastasia,japanwest,japaneast,koreacentral,koreasouth,indiasouth,indiawest,indiacentral,australiaeast,australiasoutheast,canadacentral,canadaeast,uksouth,ukwest,francecentral,francesouth,australiacentral,australiacentral2,uaecentral,uaenorth,southafricanorth,southafricawest,switzerlandnorth,switzerlandwest,germanynorth,germanywestcentral,norwayeast,norwaywest,brazilsoutheast"
on 10-main.tf line 8, in resource "azurerm_resource_group" "resource_group":
8: resource "azurerm_resource_group" "resource_group" {
terraform applyThe most interesting thing is that centralindia is valid even when I set it in terraform and create the resource (cannot found it in the validation test?) but southindia/westindia are not :question: How come the locations are not the same API <-> provider?
Location differences. Terraform on the left, Azure on the right

By way of update. This is blocked until we get a resolution from MSFT on the locations API returning incorrect values for the India locations. Once we get reliable data back, we'll be able to merge @favoretti 's PR to correct the tests.
This is kind of absolutely weird, to change a crucial API without any backward compatibility. I guess MSFT has their own reasons.
@tombuildsstuff is there any alternate approach to do this? Sorry to pester, but it's kind of a priority :(
@tombuildsstuff is there any alternate approach to do this? Sorry to pester, but it's kind of a priority :(
The only way i got around this for making changes to our Production infrastructure was to go back to version 2.19.0 of the Azure Provider. Sadly that won't work if you need features added since 2.20.0 forwards, but for us was the only way to push required changes out.
@andydkelly-ig @rjshrjndrn as @jackofallops has mentioned unfortunately this incorrect data is coming from the Azure API - Terraform is now using this data to validate regions (to be able to offer enhanced validation at 'plan' time rather than crashing during an 'apply').
Until this is fixed on the Azure-side (which we've raised with Microsoft) you can opt-out of this by setting the environment variable ARM_PROVIDER_ENHANCED_VALIDATION to false - we'll also look to include a temporary fix for this in an upcoming release so that this isn't necessary
@AndreasAbdi @tombuildsstuff thanks for your response.
@tombuildsstuff Will ARM_PROVIDER_ENHANCED_VALIDATION=false skip other problems if found?
This has been released in version 2.25.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 2.25.0"
}
# ... other configuration ...
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
@andydkelly-ig @rjshrjndrn as @jackofallops has mentioned unfortunately this incorrect data is coming from the Azure API - Terraform is now using this data to validate regions (to be able to offer enhanced validation at 'plan' time rather than crashing during an 'apply').
Until this is fixed on the Azure-side (which we've raised with Microsoft) you can opt-out of this by setting the environment variable
ARM_PROVIDER_ENHANCED_VALIDATIONtofalse- we'll also look to include a temporary fix for this in an upcoming release so that this isn't necessary