
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
serverless-step-functions-localhost
Advanced tools
Run AWS step functions offline with Serverless!
This is a plugin for the Serverless Framework. It uses stepfunctions-localhost to emulate step functions with AWS' provided tool for local development.
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 config with accountId and region parameters:
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 ./.step-functions-local.
The plugin binds to port 8083, this cannot be changed. The plugin binds to port 8083, since stepfunctions-localhost doesn't support dynamic port, it can't 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 OFFLINE_STEP_FUNCTIONS_ARN_WaitMachine.
(These go under custom.stepFunctionsLocal.)
accountId (required) your AWS account IDregion (required) your AWS regionlambdaEndpoint (defaults to http://localhost:3000 from serverless offline) the endpoint for the lambda service. This plugin tries to use the configured value from serverless-offlinepath (defaults to ./.step-functions-local) the path to store the downloaded step function executablesTaskResourceMapping allows for Resource ARNs to be configured differently for local development. (Serverless 3.x prefixes the lambda function names with the stack name and the stage)eventBridgeEvents allows sending EventBridge events on execution status changes
enabled (bool) enabled or disable this feature. Disabled by default.endpoint Endpoint for sending events to eg. for serverless-offline-aws-eventbridge would be http://localhost:4010externalInstance allows to set a flag to use external instance of local step functions. Disabled by default.stepFunctionsEndpoint (defaults to http://localhost:8083) the endpoint for the step functions serviceservice: local-step-function
plugins:
- serverless-step-functions
- serverless-step-functions-local
- serverless-offline-lambda
- serverless-offline
provider:
name: aws
runtime: nodejs14.x # supported nodejs versions: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
custom:
stepFunctionsLocal:
accountId: 101010101010
region: us-east-1
TaskResourceMapping:
FirstState: arn:aws:lambda:us-east-1:101010101010:function:${self:service}-${opt:stage, self:provider.stage}-hello
FinalState: arn:aws:lambda:us-east-1:101010101010:function:${self:service}-${opt:stage, self:provider.stage}-hello
eventBridgeEvents:
enabled: true
endpoint: http://localhost:4010
sqsUrl: http://localhost:4566/101010101010/example-queue
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: send_message
send_message:
Type: Task
Resource: arn:aws:states:::sqs:sendMessage
Parameters:
QueueUrl: ${self:custom.sqsUrl}
"MessageBody.$": "$"
Next: wait_using_seconds
wait_using_seconds:
Type: Wait
Seconds: 10
Next: FinalState
FinalState:
Type: Task
Resource: Fn::GetAtt: [hello, Arn]
End: true
To run your local step function, use this command:
aws stepfunctions --endpoint-url http://localhost:8083 start-execution --state-machine-arn arn:aws:states:us-east-1:101010101010:stateMachine:servicename-stagename-hello --input '{"hello": ["world"]}'
To run external step functions local using docker, use this command:
docker run \
-p 8083:8083 \
-e "AWS_ACCOUNT_ID=101010101010" \
-e "AWS_DEFAULT_REGION=us-east-1" \
-e "LAMBDA_ENDPOINT=http://localhost:4000" \
amazon/aws-stepfunctions-local
FAQs
Run AWS step functions offline with Serverless
The npm package serverless-step-functions-localhost receives a total of 5 weekly downloads. As such, serverless-step-functions-localhost popularity was classified as not popular.
We found that serverless-step-functions-localhost demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.