Gathering detailed insights and metrics for serverless-step-functions-local
Gathering detailed insights and metrics for serverless-step-functions-local
Gathering detailed insights and metrics for serverless-step-functions-local
Gathering detailed insights and metrics for serverless-step-functions-local
serverless-step-functions-local-docker
Run AWS step functions offline with Serverless
serverless-step-functions
The module is AWS Step Functions plugin for Serverless Framework
serverless-webpack
Serverless plugin to bundle your javascript with Webpack
serverless
[![Serverless Framework AWS Lambda AWS DynamoDB AWS API Gateway](https://github.com/serverless/serverless/assets/2752551/66a8c6a9-bc4a-4116-b139-90c12963337e)](https://serverless.com)
npm install serverless-step-functions-local
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
17 Stars
56 Commits
17 Forks
4 Watching
1 Branches
9 Contributors
Updated on 04 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-43.7%
397
Compared to previous day
Last week
-27.1%
2,398
Compared to previous week
Last month
30.2%
12,003
Compared to previous month
Last year
-10.5%
134,124
Compared to previous year
4
1
1
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:
1plugins: 2 ... 3 - serverless-step-functions 4 - serverless-step-functions-local 5 - serverless-offline-lambda 6 - serverless-offline 7 ...
Then, add a new section to config
with accountId
and region
parameters:
1custom: 2 stepFunctionsLocal: 3 accountId: 101010101010 4 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:4010
externalInstance
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 service1service: local-step-function 2 3plugins: 4 - serverless-step-functions 5 - serverless-step-functions-local 6 - serverless-offline-lambda 7 - serverless-offline 8 9provider: 10 name: aws 11 runtime: nodejs14.x # supported nodejs versions: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html 12 13 14custom: 15 stepFunctionsLocal: 16 accountId: 101010101010 17 region: us-east-1 18 TaskResourceMapping: 19 FirstState: arn:aws:lambda:us-east-1:101010101010:function:${self:service}-${opt:stage, self:provider.stage}-hello 20 FinalState: arn:aws:lambda:us-east-1:101010101010:function:${self:service}-${opt:stage, self:provider.stage}-hello 21 eventBridgeEvents: 22 enabled: true 23 endpoint: http://localhost:4010 24 sqsUrl: http://localhost:4566/101010101010/example-queue 25 26functions: 27 hello: 28 handler: handler.hello 29 30stepFunctions: 31 stateMachines: 32 WaitMachine: 33 definition: 34 Comment: "An example of the Amazon States Language using wait states" 35 StartAt: FirstState 36 States: 37 FirstState: 38 Type: Task 39 Resource: Fn::GetAtt: [hello, Arn] 40 Next: send_message 41 send_message: 42 Type: Task 43 Resource: arn:aws:states:::sqs:sendMessage 44 Parameters: 45 QueueUrl: ${self:custom.sqsUrl} 46 "MessageBody.$": "$" 47 Next: wait_using_seconds 48 wait_using_seconds: 49 Type: Wait 50 Seconds: 10 51 Next: FinalState 52 FinalState: 53 Type: Task 54 Resource: Fn::GetAtt: [hello, Arn] 55 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
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More