I’m trying to create an Azure Traffic Manager Endpoint via Terraform, but I don’t know what to put in "geo_mappings" value. This is my resource:
resource "azurerm_traffic_manager_azure_endpoint" "se22condary-ae" {
name = "se22condary-endpoint"
profile_id = azurerm_traffic_manager_profile.tm.id
target_resource_id = azurerm_linux_web_app.secondary.id
geo_mappings = ["Europe"]
}
And I have this error:
Error: creating/updating Endpoint Type (Subscription: "xxx"
│ Resource Group Name: "ist-platform-geodev2"
│ Traffic Manager Profile Name: "ist-traffic-manager-geodev2"
│ Endpoint Type: "AzureEndpoints"
│ Endpoint Name: "s22econdary-endpoint"): endpoints.EndpointsClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The following locations specified in the geoMapping property for endpoint ‘s22econdary-endpoint’ are not supported: EUROPE. For a list of supported locations, see the Traffic Manager documentation."
│
│ with azurerm_traffic_manager_azure_endpoint.se22condary-ae,
│ on main-geodev2.tf line 475, in resource "azurerm_traffic_manager_azure_endpoint" "se22condary-ae":
│ 475: resource "azurerm_traffic_manager_azure_endpoint" "se22condary-ae" {
It seems that the Azure documentation is not updated and I can’t find values. I tryed with "Europe" "EU" "North Europe", but problem still
2
Answers
I've found the solution. I created manually the resource on Azure and then I used this command:
to retrieve information about the endpoint I created manually. The sintax is: "GEO-EU"
for instance, if you want to put North America you will write "GEO-NA"
You can use the Geographic Hierarchies – Get Default endpoint or run the following Azure CLI command to get the list of country/region codes:
From the output we can see that the code for Europe region is
GEO-EU
: