Skip to content

Commit

Permalink
fix(aws-ecs): use executionRole for event rule target (#2165)
Browse files Browse the repository at this point in the history
Fixes #2015.
  • Loading branch information
SoManyHs authored and rix0rrr committed Apr 3, 2019
1 parent 4864cc8 commit aa6f7bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ecs/lib/ec2/ec2-event-rule-target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class Ec2EventRuleTarget extends cdk.Construct implements events.IEventRu
//
// It never needs permissions to the Task Role.
if (this.taskDefinition.executionRole !== undefined) {
this.taskDefinition.taskRole.grantPassRole(this.eventsRole);
this.taskDefinition.executionRole.grantPassRole(this.eventsRole);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@
"Action": "lambda:InvokeFunction",
"FunctionName": {
"Fn::GetAtt": [
"EcsClusterDefaultAutoScalingGroupDrainECSHookFunctionE17A5F5E",
"Arn"
"EcsClusterDefaultAutoScalingGroupDrainECSHookFunctionE17A5F5E",
"Arn"
]
},
"Principal": "sns.amazonaws.com",
Expand Down Expand Up @@ -912,7 +912,7 @@
"Effect": "Allow",
"Resource": {
"Fn::GetAtt": [
"TaskDefTaskRole1EDB4A67",
"TaskDefExecutionRoleB4775C97",
"Arn"
]
}
Expand Down Expand Up @@ -1163,4 +1163,4 @@
"Description": "S3 key for asset version \"aws-ecs-integ-ecs/AdoptEcrRepositorydbc60defc59544bcaa5c28c95d68f62c/Code\""
}
}
}
}

0 comments on commit aa6f7bc

Please sign in to comment.