Gathering detailed insights and metrics for serverless-step-functions-offline-async
Gathering detailed insights and metrics for serverless-step-functions-offline-async
Gathering detailed insights and metrics for serverless-step-functions-offline-async
Gathering detailed insights and metrics for serverless-step-functions-offline-async
serverless-step-functions
The module is AWS Step Functions plugin for Serverless Framework
serverless-offline
Emulate AWS λ and API Gateway locally when developing your Serverless project
serverless-step-functions-local
Run AWS step functions offline with Serverless
serverless-webpack
Serverless plugin to bundle your javascript with Webpack
npm install serverless-step-functions-offline-async
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
113 Commits
17 Branches
1 Contributors
Updated on 20 May 2021
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-57.9%
8
Compared to previous week
Last month
23.9%
57
Compared to previous month
Last year
72.5%
276
Compared to previous year
7
This is a fork of serverless-step-functions-offline with added support for async Lambda handlers.
:warning: Version 2.0 with breaking changes see usage :warning:
Using NPM:
1npm install serverless-step-functions-offline-async --save-dev
or Yarn:
1yarn add serverless-step-functions-offline-async --dev
Add the plugin to your serverless.yml
:
1# serverless.yml 2 3plugins: 4 - serverless-step-functions-offline
To verify that the plugin works, run this in your command line:
1sls step-functions-offline
It should rise an error like that:
Serverless plugin "serverless-step-functions-offline" initialization errored: Please add ENV_VARIABLES to section "custom"
This plugin works only with serverless-step-functions.
You must have this plugin installed and correctly specified statemachine definition using Amazon States Language.
Example of statemachine definition you can see here.
After all steps are done, need to add to section custom in serverless.yml the key stepFunctionsOffline with properties stateName: name of lambda function.
For example:
1service: ServerlessStepPlugin 2frameworkVersion: ">=1.13.0 <2.0.0" 3plugins: 4 - serverless-step-functions-offline 5 6# ... 7 8custom: 9 stepFunctionsOffline: 10 FirstLambda: firstLambda #(v2.0) 11 # ... 12 # ... 13 SecondLambda: secondLambda #(v2.0) 14 15functions: 16 firstLambda: 17 handler: firstLambda/index.handler 18 name: TheFirstLambda 19 secondLambda: 20 handler: secondLambda/index.handler 21 name: TheSecondLambda 22stepFunctions: 23 stateMachines: 24 foo: 25 definition: 26 Comment: "An example of the Amazon States Language using wait states" 27 StartAt: FirstLambda 28 States: 29 FirstLambda: 30 Type: Task 31 Resource: arn:aws:lambda:eu-west-1:123456789:function:TheFirstLambda 32 Next: SecondLambda 33 SecondLambda: 34 Type: Task 35 Resource: arn:aws:lambda:eu-west-1:123456789:function:TheSecondLambda 36 End: true
Where:
StepOne
is the name of step in state machinefirstLambda
is the name of function in section functionsLambda handler functions can use async
:
firstLambda/index.js
:
1module.exports = async function handler (event, context, callback) { 2 ... 3}
1sls step-functions-offline --stateMachine={{name}} --event={{path to event file}}
name
: name of state machine in section state functions. In example above it's foo
.event
: input values for execution in JSON format (optional)If you want to know where you are (in offline mode or not) you can use env variable STEP_IS_OFFLINE
.
By default process.env.STEP_IS_OFFLINE = true
.
States | Support |
---|---|
Task | At this moment plugin does not support fields Retry, Catch, TimeoutSeconds, HeartbeatSeconds |
Choice | All comparison operators except: And, Not, Or |
Wait | All following fields: Seconds, SecondsPath, Timestamp, TimestampPath |
Parallel | Only Branches |
Pass | Result, ResultPath |
Fail | Cause, Error |
Succeed |
The plugin integrates very well with serverless-webpack.
Add the plugins serverless-webpack
to your serverless.yml
file and make sure that serverless-webpack
precedes serverless-step-functions-offline
as the order is important:
1 plugins: 2 ... 3 - serverless-webpack 4 ... 5 - serverless-step-functions-offline 6 ...
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
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
77 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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