I'm submitting an AWS Batch job from a Step Function. The batch job takes command line parameters. I can run it in the step function like this:
{
"Comment": "Submit aws batch job with parameters",
"StartAt": "SubmitJob",
"States": {
"SubmitJob": {
"Type": "Task",
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobName": "my-job",
"JobDefinition": "arn:aws:batch:us-west-1:123456789000:job-definition/my-job-definition:1",
"JobQueue": "arn:aws:batch:us-west-1:123456789000:job-queue/my-job-queue",
"ContainerOverrides": {
"Command": [
"Hello",
"World"
]
}
},
"End": true
}
}
}
However, I would like to use the input to this step as the command line parameters. So I try to use the $.parameter notation in the Command.
My input is
{
"param_1": "Hello",
"param_2": "World"
}
and my step function is
{
"Comment": "Submit aws batch job with parameters",
"StartAt": "SubmitJob",
"States": {
"SubmitJob": {
"Type": "Task",
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobName": "my-job",
"JobDefinition": "arn:aws:batch:us-west-1:123456789000:job-definition/my-job-definition:1",
"JobQueue": "arn:aws:batch:us-west-1:123456789000:job-queue/my-job-queue",
"ContainerOverrides": {
"Command": [
"$.param_1",
"$.param_2"
]
}
},
"End": true
}
}
}
However, this results in my batch job receiving the raw strings like "$.param_1" rather than them being substituted by the input "Hello". Why? What is required instead?