Serverless Offline plugin to support step functions.
# dependencies:
$ npm install -D serverless-offline, serverless-step-functions
# the fun stuff
$ npm install -D serverless-offline-step-functions
- Add to plugins section in
serverless.yml
:
plugins:
- serverless-step-functions
- serverless-offline-step-functions
- serverless-offline
- If your resources have a prefix added during deploy time, add the
resourcePrefix
confing to theserverless.yml
custom section. This will allowserverless-offline-step-functions
to find the resources. See below for an example:
custom:
serverless-offline-step-functions:
resourcePrefix: ${self:service}-${self:provider.stage}-
- If you use serverless-plugin-typescript, you may need to have custom path where the code is transpiled
custom:
serverless-offline-step-functions:
srcPath: '.build'
The plugin also sets up a server to run any lambdas that make use of the StepFunctions API in the aws-sdk
. The default port is 8014
; however, you can specify which port to listen to like so:
custom:
serverless-offline-step-functions:
port: 8014
Serveless Offline will now be able to run your state machines similar to AWS!
- Task
- Pass
- Wait
- Succeed
- Fail
- Choice
- Parallel
For a full (Hello World) example project, take a look at this repo:
For a walkthrough of the example project and to learn more about AWS States and Step Functions, checkout my post on Medium
:
Stepping Through AWS Step Functions
For AWS' documentation, you can start here: