I am trying to convert my long running lambda functions into separate workflows using step functions and/or sqs. My main requirement is that we have to run these locally and verify the workflow before we deploy.
My workflow is:
API Gateway -> Lambda (step-function) -> Lambda (step-function) -> Lambda -> HTTP (external API)
Right now I have a working API Gateway -> Lambda -> HTTP, but there is so much processing going on that I have been running into the occasional 30 second timeout issues on the API Gatway’s end. Since the clients cannot support (at this time) Websockets, thats not an option right now.
API Gateway -> Lambda -> SQS -> Lambda -> SQS -> Lambda -> HTTP
Option 1: the various offline step function plugins.
So far I spent most of the day working with the serverless-offline-step-functions plugins but its very buggy and has some limitations.
- I cant seem to trigger it from an existing API gateway. It must be triggered from a separate port.
- When I do trigger it. I get errors “undefined: 1” (I’ll report that to their own github site)
- no way to monitor the workflows that I can see.
I looked at a few other plugins:
https://github.com/pianomansam/serverless-offline-stepfunctions-local with https://github.com/pianomansam/serverless-offline-stepfunctions-local and
but before I spend more time on those, I was wondering if there was one that does a great job before I test each one only to find they don’t work.
Option 2: localstack
I have not tried that but it seems like it could work once you get through all the configuration steps.
Option 3: offline sqs
There are a few plugins here too. But like the step-function plugins, I wonder how well these are maintained and what their limitations are. It seems most of these cannot be passed from lambda to sqs but rather must be triggered from a mock sqs command.
It seems the only way to get a real understanding of how the application will work is to simply use real deployed sandbox stacks in AWS, but we have some restrictions in place that make that difficult.
So for those who have gone before… what is the best way to approach this?