This repository is no longer being maintained. Further developments to this repository can be made by forking the project.
Merge a JSON file with your provider or functions environment objects.
Requirements:
- Serverless v1.12.x or higher.
- AWS provider
JSON Environment plugin will parse and merge with your environment objects whatever JSON string you pass. This plugin is useful to use with the new S3 variables syntax avoiding the hassle to add individually all environment Key/Value to S3.
Install via npm in the root of your Serverless service:
npm install serverless-plugin-jsonenv --save-dev
- Add the plugin to the
plugins
array in your Serverlessserverless.yml
:
plugins:
- serverless-plugin-jsonenv
- Add
environmentJSON: ${s3:myBucket/myEnvironment.json}
property toprovider
orfunction
:
provider:
environmentJSON: ${s3:myBucket/providerEnvironment.json}
functions:
hello:
environmentJSON: ${s3:myBucket/helloEnvironment.json}
- All done! JSON Environment will run on SLS
deploy
andinvoke local
commands
Help us making this plugin better and future proof.
- Clone the code
- Install the dependencies with
npm install
- Create a feature branch
git checkout -b new_feature
- Lint with standard
npm run lint
This software is released under the MIT license. See the license file for more details.