Hi Folks
In the terraform console(Terraform v1.1.5) I’m wanting to join 2 list(map(string)) variable types removing any duplicates on “name” and keeping the map entry in the var_a in this case but the distinct function doesn’t seem to be doing this. Any ideas on how I can do this please? For example, in the below I would want to strip out the name1 = 1000 map
> var.var_a
tolist([
tomap({
"name" = "name1"
"value" = "2000"
}),
])
>
> var.var_b
tolist([
tomap({
"name" = "name1"
"value" = "1000"
}),
tomap({
"name" = "name2"
"value" = "20"
}),
tomap({
"name" = "name3"
"value" = "30"
}),
])
>
> distinct(concat(var.var_a,var.var_b))
tolist([
tomap({
"name" = "name1"
"value" = "2000"
}),
tomap({
"name" = "name1"
"value" = "1000"
}),
tomap({
"name" = "name2"
"value" = "20"
}),
tomap({
"name" = "name3"
"value" = "30"
}),
])