Skip to content

Commit

Permalink
docs(stepfunctions-tasks): clarify that ITaskDefinition cannot be use…
Browse files Browse the repository at this point in the history
…d in RunEcsEc2Task. (#3425)

Fixes #2948
  • Loading branch information
skinny85 authored and Elad Ben-Israel committed Jul 25, 2019
1 parent 6d762f9 commit eaf8aa6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export interface CommonEcsRunTaskProps {
readonly cluster: ecs.ICluster;

/**
* Task Definition used for running tasks in the service
* Task Definition used for running tasks in the service.
*
* Note: this must be TaskDefinition, and not ITaskDefinition,
* as it requires properties that are not known for imported task definitions
*/
readonly taskDefinition: ecs.TaskDefinition;

Expand Down Expand Up @@ -154,8 +157,8 @@ export class EcsRunTaskBase implements ec2.IConnectable, sfn.IStepFunctionsTask
// Need to be able to pass both Task and Execution role, apparently
const ret = new Array<iam.IRole>();
ret.push(this.props.taskDefinition.taskRole);
if ((this.props.taskDefinition as any).executionRole) {
ret.push((this.props.taskDefinition as any).executionRole);
if (this.props.taskDefinition.executionRole) {
ret.push(this.props.taskDefinition.executionRole);
}
return ret;
}
Expand Down

0 comments on commit eaf8aa6

Please sign in to comment.