serverless-offline-variables
v0.1.0
Published
Mock serverless variables in offline or localstack mode
Downloads
3,560
Maintainers
Readme
serverless-offline-variables
About
serverless-offline-variables
is a lightweight plugin to replace ${cf:}, ${s3:}, ${ssm:} and ${env:}
parameters during the local (offline) runs, which can be very useful when testing microservices in isolation.
Installation
Use yarn
or npm
to add the plugin to your package dependecies:
npm install --save-dev serverless-offline-variables
or
yarn add serverless-offline-variables --dev
Usage
- Add plugin to you serverless plugins
plugins:
...
- serverless-offline-variables
- Configure plugin (optional)
custom:
...
offline-variables:
stages:
- local # Default
file: .env # Default
variables: # Optional
- ssm:hello-world: my value
By default plugin will first try to locate your variable in .env
file
(or in the file you specified), and only then under the variables
section.
If serverless-offline-variables
fails to locate a variable it falls back
to original resolver.
Contributions
You are welcome to create pull requests to improve the project. Please check out the contribution quick guide to get started.
License
The project is distributed under MIT license.