Open elemakil opened 4 years ago
We need this too. Specifically for containerOverrides.environment
. But I guess containerOverrides
alone could do the trick.
We also ran into this issue on a recent project, and it took some time to come up with workarounds. The CDK typing for ContainerOverrides.Environment prevents the use of JSON Task Input expression for the entire list of environment variables.
According to the documentation of the AWS Batch service integration pattern for AWS StepFunctions (link), the service integration pattern supports the following parameters of the AWS Batch job:
As far as I can tell, currently (v1.66.0), the
aws-stepfunctions-tasks.BatchSubmitJob
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 thepayload
construct prop.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 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" is constructed and rendered.
Other
This is a :rocket: Feature Request