Manage AWS Batch with Step Functions
Step Functions can control certain AWS services directly from Amazon States Language (ASL). To learn more, see Working with other services and Pass parameters to a service API.
How the Optimized AWS Batch integration is different than the AWS BatchAWS SDK integration
The Run a Job (.sync) integration pattern is available.
Note that there are no optimizations for the Request Response or Wait for a Callback with the Task Token integration patterns.
Supported AWS Batch APIs:
Note
Parameters in Step Functions are expressed in PascalCase, even if the native service API is in camelCase. For example, you could use the Step Functions API action startSyncExecution
and specify its parameter as StateMachineArn
.
The following includes a Task
state that submits an AWS Batch job and waits
for it to complete.
{
"StartAt": "BATCH_JOB",
"States": {
"BATCH_JOB": {
"Type": "Task",
"Resource": "arn:aws:states:::batch:submitJob.sync",
"Parameters": {
"JobDefinition": "preprocessing",
"JobName": "PreprocessingBatchJob",
"JobQueue": "SecondaryQueue",
"Parameters.$": "$.batchjob.parameters",
"ContainerOverrides": {
"ResourceRequirements": [
{
"Type": "VCPU",
"Value": "4"
}
]
}
},
"End": true
}
}
}
For information about how to configure IAM permissions when using Step Functions with other AWS services, see IAM Policies for integrated services.