[aws-stepfunctions-tasks] Batch SubmitJob: Support TaskInput on all Parameters supported by service integration
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
According to the documentation of the AWS Batch service integration pattern for AWS StepFunctions ([link](https://docs.aws.amazon.com/step-functions/latest/dg/connect-batch.html)), the service integration pattern supports the following parameters of the AWS Batch job:
- ArrayProperties
- ContainerOverrides
- DependsOn
- JobDefinition
- JobName
- JobQueue
- Parameters
- RetryStrategy
- Timeout
As far as I can tell, currently (v1.66.0), the [`aws-stepfunctions-tasks.BatchSubmitJob`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions-tasks.BatchSubmitJob.html) CDK construct
does not support passing data into the AWS Batch Service from the AWS StepFunction event object using the JSON path for any of the above parameters *except* for the "Parameters" parameter (sorry for the confusing naming...) through the [`payload` construct prop](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions-tasks.BatchSubmitJob.html#payload).
As the service integration pattern supports all these additional parameters with JSON path, it seems sensible for the CDK construct to also support this feature.
### Use Case
I would like to be able to configure the supported AWS Batch service integration parameters using the event object passed into the stepfunction task.
To me, this is particularly useful for the JobName, JobQueue, JobDefinition parameters as well as the ContainerOverrides parameter, whose nested elements allow to override the actual command executed by the AWS batch job.
### Proposed Solution
In addition to the current data type, the construct props which map to AWS StepFunctions service integration parameters should accept a [aws-stepfunctions.TaskInput](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.TaskInput.html) object. Depending on the type of the supplied data, a parameter is filled in either using the current behaviour or a JSON path according to ["Pass Parameters to a Service API"](https://docs.aws.amazon.com/step-functions/latest/dg/connect-parameters.html) is constructed and rendered.
### Other
* [x] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Start from the aws-stepfunctions-tasks.BatchSubmitJob construct and the TaskInput and AWS Step Functions service-integration documentation linked in the issue. Review how the existing payload is rendered, then verify that all listed AWS Batch parameters accept JSON-path input while preserving current value behavior; done when the construct supports those parameters and its existing behavior remains compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100