aws-stepfunctions-tasks: Provide task definition as JSONata/JSONPath in .sync EcsRunTask
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
The ability to provide the task definition ARN as a JSONata/JSONPath in `aws_stepfunctions_tasks.EcsRunTask` with the `.sync` integration pattern.
### Use Case
Our team has a requirement to run a ECS RunTask sfn task with the `.sync` integration pattern by using an ECS task definition generated by a subsequent ECS RegisterTaskDefinition sfn task. The most practical way to reference the newly created task definition ARN in the RunTask sfn task is via a JSONata/JSONPath expression. Currently the `aws_stepfunctions_tasks.EcsRunTask` only accepts a `aws_ecs.TaskDefinition`. The `aws_stepfunctions_tasks.CallAwsService` cannot be used a work around since it does not allow the `integrationPattern` to be set to `aws_stepfunctions.IntegrationPattern.RUN_JOB`.
### Proposed Solution
This feature may be introduced as a new string attribute within `aws_stepfunctions_tasks.EcsRunTaskProps`, `taskDefinitionArn`, where either the task definition ARN or a JSONata/JSONPath which evaluates to the task definition ARN may be provided. CDK users must then provide either a `taskDefinition` or `taskDefinitionArn` but not both.
### Other Information
The `aws_cdk.aws_stepfunctions.CustomState` resource can be used as a work around by setting the state `Resource` to `"arn:aws:states:::ecs:runTask.sync"`.
### Acknowledgements
- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### AWS CDK Library version (aws-cdk-lib)
2.212.0
### AWS CDK CLI version
2.1025.0
### Environment details (OS name and version, etc.)
macOs Sonoma Version 14.6.1
Contributor guide
Research direction
The entry point is aws_stepfunctions_tasks.EcsRunTask and its EcsRunTaskProps; compare the existing taskDefinition path with the CustomState workaround using arn:aws:states:::ecs:runTask.sync. Verify that either taskDefinition or taskDefinitionArn accepts a literal ARN or JSONata/JSONPath, rejects both or neither, and preserves the .sync integration pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100