Hi @AnitaErnszt,
I think the crucial difference between your example and what I shared earlier is that you didn’t use the ... symbol to enable Expanding Function Arguments, and so your expression is passing the tuple created by the [ for ... ] expression as a single argument to merge; for this to actually work, each element of that tuple must be passed as a separate argument to merge, which is what the ... modifier achieves.
configs = merge([
for env_key, env_name in local.environments : {
for region in local.regions:
"${env_key}_${region}" => env_name
}
]...)
(Notice the additional ... I’ve added on the last line of the example.)