Hi there is there any neat way to convert a map(map(map(list(string)))) into a map(map(list(string))) with terraform .
Here's what my input structure looks like :
exception_expr_rule = {
"project" = {
"user" = {
sqli-stable = [
"value",
],
xss-stable = [
"value",
"value",
"value"
],
rce-stable = [
"value"
],
...... = []
},
"user2" = {
xss-stable = [
"value",
],
other-subsubkey = [
"value"
],
other-subsubkey = [
"value"
],
other-subsubkey = [
"value"
],
}
"userN" = {....}
}}
and here's what i want it to look like :
exception_expr_rule = {
"project.user" = {
sqli-stable = [
"value",
],
xss-stable = [
"value",
"value",
"value"
],
rce-stable = [
"value"
]
},
"project.user2" = {
xss-stable = [
"value",
],
other-subsubkey = [
"value"
],
.....
}
"project.userN" = {.....}
}
Can you guys help me achieve this please ?
I tried via
exception_expr_rule_list = flatten([
for projects,value in var.expr_rule_list : [
for user_name,exceptions in value: {
key = "${projects}.${user_name}"
value = exceptions
}
]
])
But is not wat i want.