support different key names for service accounts in IAM interpolation (#3279)
Fixes #3278
This commit is contained in:
committed by
GitHub
parent
ecb38dfd0e
commit
89d8911741
@@ -61,6 +61,7 @@ module "automation-bucket" {
|
||||
iam = {
|
||||
for k, v in lookup(each.value, "iam", {}) : k => [
|
||||
for vv in v : try(
|
||||
module.automation-service-accounts["${each.key}/automation/${vv}"].iam_email,
|
||||
module.automation-service-accounts["${each.key}/${vv}"].iam_email,
|
||||
var.factories_config.context.iam_principals[vv],
|
||||
vv
|
||||
@@ -92,6 +93,7 @@ module "automation-bucket" {
|
||||
iam_bindings_additive = {
|
||||
for k, v in lookup(each.value, "iam_bindings_additive", {}) : k => merge(v, {
|
||||
member = try(
|
||||
module.automation-service-accounts["${each.key}/automation/${v.member}"].iam_email,
|
||||
module.automation-service-accounts["${each.key}/${v.member}"].iam_email,
|
||||
var.factories_config.context.iam_principals[v.member],
|
||||
v.member
|
||||
|
||||
Reference in New Issue
Block a user