We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bd028b commit 53fe2deCopy full SHA for 53fe2de
iam.tf
@@ -331,10 +331,10 @@ resource "aws_iam_role_policy_attachment" "additional_one" {
331
######################################
332
333
resource "aws_iam_role_policy_attachment" "additional_many" {
334
- count = local.create_role && var.attach_policies ? var.number_of_policies : 0
+ for_each = { for k, v in toset(var.policies) : k => v if local.create_role && var.attach_policies && var.number_of_policies > 0 }
335
336
role = aws_iam_role.lambda[0].name
337
- policy_arn = var.policies[count.index]
+ policy_arn = each.value
338
}
339
340
###############################
0 commit comments