skip to Main Content

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


  1. Chosen as BEST ANSWER

    I've found the solution. I created manually the resource on Azure and then I used this command:

     az network traffic-manager endpoint list     --profile-name ist-traffic-manager-geodev2     --resource-group ist-platform-geodev2
    

    to retrieve information about the endpoint I created manually. The sintax is: "GEO-EU"

    {
        "alwaysServe": "Disabled",
        "endpointLocation": "North Europe",
        "endpointMonitorStatus": "Online",
        "endpointStatus": "Enabled",
        "geoMapping": [
          "GEO-EU"
        ],
    

    for instance, if you want to put North America you will write "GEO-NA"


  2. You can use the Geographic Hierarchies – Get Default endpoint or run the following Azure CLI command to get the list of country/region codes:

    az network traffic-manager endpoint show-geographic-hierarchy
    

    From the output we can see that the code for Europe region is GEO-EU:

    {
      "geographicHierarchy": {
        "code": "WORLD",
        "name": "World",
        "regions": [
          {
            "code": "GEO-EU",
            "name": "Europe",
            "regions": [
              {
                "code": "AD",
                "name": "Andorra",
                "regions": []
              }
    
         // rest of content here
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search