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.

Fixes aws#2948
  • Loading branch information
skinny85 committed Jul 24, 2019
1 parent c989fa4 commit 3ab80e6
Showing 1 changed file with 6 additions and 3 deletions.
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 3ab80e6

Please sign in to comment.