Reputation: 31560
I have this map:
tags = {
"Name" = "sdfsdfsdf"
"ZZZZ" = "ABC-DE"
"sdfsEEEdfsdfE" = "sdfsdfsdQQQf"
}
I want to generate a new map from that one but lower case all the keys and values.
I thought I could do this with for_each inside of locals but looks like that's not supported? I want to create a new map (via locals somehow) for this
This is not valid syntax but I want to do something like this:
locals{
test = {
for i in tags:
lower(i.key) => lower(i.key)
lower(i.value) => lower(i.value)
}
}
Upvotes: 2
Views: 1910
Reputation: 31560
This is super easy, but I had a really hard time finding an example of it for some reason
locals {
newmap = {
for key, value in local.tags :
lower(key) => lower(value)
}
}
Upvotes: 5