Using for_each in provider block

We have a need to parametrize the IP address used by a provider based on the location of a resource, which is defined as part of the user input variables. Using aliases along with the for_each statement in the provider block would appear to be a solution, except it’s use in provider blocks doesn’t appear to be supported.

In simple example terms we’d like to be able to arrive at the following configuration, but dynamically based on the content of the input rather than a static provider definition of the module :

provider "a_provider" {
 for_each = var.api_map
 alias = var.api_map[each.key]
 address = var.api_map[each.key].IPAddress

Would welcome suggestions on something equivalent to the above could be achieved.