What's the proper way to send part of a Step Function's input to a Batch Job?
I've tried setting and env var using Parameters.ContainerOverrides.Environment like this:
"Parameters": {
"ContainerOverrides": {
"Environment": [
{
"Name": "PARAM_1",
"Value": "$.param_1"
}
Step function input looks like this:
{
"param_1": "value-goes-here"
}
But the batch job just ends up getting invoked with literal "$.param_1" in the PARAM_1 env var.
Fixed. The Value key simply needed the ".$" postfix.
"Parameters": {
"ContainerOverrides": {
"Environment": [
{
"Name": "PARAM_1",
"Value.$": "$.param_1"
}
Pass it in "Parameters" (within the parent "Parameters"). Please note all parameters values are strings
"MyStepTask": {
"Type": "Task",
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "myjobdef",
"JobName": "myjobname",
"JobQueue": "myjobqueue",
"Parameters": { "p_param1":"101",
"p_param2":"201"
}
},
"Next": "MyNextStepTask"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With