I'm trying to convert a list of items into a map.
The key should match a key in the item and increment on each element with the same key.
Maybe an example will be more understable
variable "list" {
type = list(map(string))
default = [
{ a : "a", k : "node" },
{ a : "b", k : "node" },
{ a : "c", k : "master" },
{ a : "d", k : "master" }
]
}
// Output wanted
// {
// "node-0" : {a: a},
// "node-1" : {a: b},
// "master-0" : {a: c},
// "master-1" : {a: d}
// }
Thanks