From 71d9858ce6d7acbafb0528078feb8005b0f6159d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sun, 12 May 2024 09:12:45 +0000 Subject: [PATCH] Fix 0-bootstrap iam_by_principals not taking into account all principals --- fast/stages/0-bootstrap/organization.tf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fast/stages/0-bootstrap/organization.tf b/fast/stages/0-bootstrap/organization.tf index f91b4e8c14..fdd08937a7 100644 --- a/fast/stages/0-bootstrap/organization.tf +++ b/fast/stages/0-bootstrap/organization.tf @@ -138,8 +138,14 @@ module "organization" { organization_id = module.organization-logging.id # human (groups) IAM bindings iam_by_principals = { - for k, v in local.iam_principals : - k => distinct(concat(v, lookup(var.iam_by_principals, k, []))) + for key in distinct(concat( + keys(local.iam_principals), + keys(var.iam_by_principals), + )) : + key => distinct(concat( + lookup(local.iam_principals, key, []), + lookup(var.iam_by_principals, key, []), + )) } # machine (service accounts) IAM bindings iam = merge(