Skip to content

Commit 19fb5e7

Browse files
authored
Feat/DL-148: Allow data-and-insight to use PassRole on datahub-task-execution-role (#2590)
* DL-148 allow PassRole on datahub-task-execution-role * simplify a bit
1 parent fcef661 commit 19fb5e7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

terraform/modules/department/50-aws-iam-policies.tf

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,10 +1273,15 @@ data "aws_iam_policy_document" "department_ecs_passrole" {
12731273
actions = [
12741274
"iam:PassRole"
12751275
]
1276-
resources = [
1277-
aws_iam_role.department_ecs_role.arn, # Defined in 50-aws-iam-roles.tf
1278-
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${local.department_identifier}*-ecs-execution-role", # Defined in ecs repo.
1279-
]
1276+
resources = concat(
1277+
[
1278+
aws_iam_role.department_ecs_role.arn, # Defined in 50-aws-iam-roles.tf
1279+
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${local.department_identifier}*-ecs-execution-role", # Defined in ecs repo.
1280+
],
1281+
local.department_identifier == "data-and-insight" ? [
1282+
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/datahub-task-execution-role" # Defined in dap-datahub repo
1283+
] : []
1284+
)
12801285
condition {
12811286
test = "StringEquals"
12821287
variable = "iam:PassedToService"

0 commit comments

Comments
 (0)