This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
serverless-step-functions-local with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Run AWS step functions offline with Serverless!
npm install serverless-step-functions-local -D
You'll need to add this plugin to your
serverless.yml. The plugins section should look something like this when you're done:
plugins: ... - serverless-step-functions - serverless-step-functions-local - serverless-offline-lambda - serverless-offline ...
Then, add a new section to
custom: stepFunctionsLocal: accountId: 101010101010 region: us-east-1
Although not neccessary, it's strongly recomended to add the folder with the downloaded step function executables to
.gitignore. By default, this path is
The plugin binds to port 8083, this cannot be changed.
It also adds an environment variable for each created state machine that contains the ARN for it. These variables are prefixed by
OFFLINE_STEP_FUNCTIONS_ARN_, so the ARN of a state machine named 'WaitMachine', for example could be fetched by reading
(These go under
accountId(required) your AWS account ID
region(required) your AWS region
http://localhost:4000) the endpoint for the lambda service
./.step-functions-local) the path to store the downloaded step function executables
TaskResourceMappingallows for Resource ARNs to be configured differently for local development
service: local-step-function plugins: - serverless-step-functions - serverless-step-functions-local - serverless-offline-lambda - serverless-offline provider: name: aws runtime: nodejs10.x custom: stepFunctionsLocal: accountId: 101010101010 region: us-east-1 TaskResourceMapping: FirstState: arn:aws:lambda:us-east-1:101010101010:function:hello FinalState: arn:aws:lambda:us-east-1:101010101010:function:hello functions: hello: handler: handler.hello stepFunctions: stateMachines: WaitMachine: definition: Comment: "An example of the Amazon States Language using wait states" StartAt: FirstState States: FirstState: Type: Task Resource: Fn::GetAtt: [hello, Arn] Next: wait_using_seconds wait_using_seconds: Type: Wait Seconds: 10 Next: FinalState FinalState: Type: Task Resource: Fn::GetAtt: [hello, Arn] End: true