updated to be more accurate
Hi Folks,
I have been banging my head for a few days trying to do this. I know I have probably seen it before but google is failing me.
I have created a local from a data source.:
locals {
my_new_map = [for group in data.okta_groups.aws_groups.groups: {
id = group.id
name = group.name
} if contains(local.groups_not_to_check, group.name) == false]
}
the result is
{
id = <group1id>
name = <group1name>
}
{
id = <group2id>
name = <group2name>
}
{
...
}
What i need is to transform it to this:
[
<group1name> = <group1id>
<group2name> = <group2id>
...
]
groupnames and ids are all unique so can be used as keys
Don’t know if it is possible in my for statement or not but am willing to create a local to do it.
Any help would be awesome.