AWS Batch with Lambda

This sample project demonstrates how to use Step Functions to pre-process data with AWS Lambda functions and then orchestrate AWS Batch jobs. Deploying this sample project will create an AWS Step Functions state machine, a Lambda function, and an AWS Batch job.

In this project, Step Functions uses a state machine to invoke a Lambda function to do simple pre-processing before an AWS Batch job is submitted. The Lambda function simulates producing variable input for an AWS Batch job by generating a random number and passing it as input to the Batch Job state.
The batch job state submits an AWS Batch job using the randomly generated number as an input to the job. The Batch job simply echoes this value.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/batch-lambda-tf/cd step-functions-workflows-collection/batch-lambda-tf

Deploy

terraform initterraform apply


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: terraform destroy.

Additional resources

Created by:

Mike Ellis

Mike Ellis

Mike is a Technical Account Manager at AWS.

Follow on LinkedIn