Skip to content

Commit 80d81a1

Browse files
committed
make the policy more flexible
Strip any task definition version, if provided, then add ":*" to the end. This should work whether the variable has an asterisk, a number, or neither.
1 parent 82c9850 commit 80d81a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resource "aws_iam_role_policy" "this" {
4040
{
4141
Effect = "Allow"
4242
Action = "ecs:RunTask"
43-
Resource = replace(var.task_definition_arn, "/:\\d+$/", ":*")
43+
Resource = "${replace(var.task_definition_arn, "/:\\d+$/", "")}:*"
4444
},
4545
]
4646
})

0 commit comments

Comments
 (0)