Hi,
I have the folowing yaml structure given and need to iterate over it vie some nested for loops. How can I achive this.
aws:
ciss-goesaws-shared-services:
name: "ciss-goesaws-shared-services"
id: "277015281744"
roles:
AdministratorAccess:
name: "AdministratorAccess"
pipelines:
custom-labor:
name: "custom-labor"
namespace: all
project: all
vault-auth01-labor:
namespace: 110
project: 207
pipeline-includes-ubuntu-aws:
namespace: 107
project: 232
Billing:
name: "Billing"
ViewOnlyAccess:
name: "ViewOnlyAccess"
I tried with this. But how can I access the 3rd level values?
locals {
roles = flatten([
for a, roles in local.aws_accounts : [
for r, pipeline in roles.roles : [
for pl in pipeline.pipelines : {
account_name = a.name
account_id = a.id
role_name = r
pipeline_name = pl
}
]
]
])
}
for_each = {
for s in local.roles : "custom--auth01--${s.account_id}-${s.account_name}--${s.role_name}--${s.pipeline_name}" => s
}