Skip to content

Commit

Permalink
fix(aws-ecs): use executionRole for event rule target
Browse files Browse the repository at this point in the history
Fixes aws#2015.
  • Loading branch information
SoManyHs committed Apr 2, 2019
1 parent 997dbcc commit acd2de1
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 acd2de1

Please sign in to comment.