Skip to content

Commit ac73063

Browse files
authored
enable multiple additional policies (#25)
1 parent 62b41b1 commit ac73063

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ resource "aws_iam_role_policy_attachment" "ecs_task_execution_role_policy_attach
1414
}
1515

1616
resource "aws_iam_policy" "ecs_task_execution_role_custom_policy" {
17-
for_each = toset(var.ecs_task_execution_role_custom_policies)
18-
name = "${var.name_prefix}-ecs-task-execution-role-custom-policy"
17+
for_each = {for s in var.ecs_task_execution_role_custom_policies: index(var.ecs_task_execution_role_custom_policies, s) => s}
18+
name = "${var.name_prefix}-ecs-task-execution-role-custom-policy-${each.key}"
1919
description = "A custom policy for ${var.name_prefix}-ecs-task-execution-role IAM Role"
2020
policy = each.value
2121
tags = var.tags

0 commit comments

Comments
 (0)