Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 2.12 KB

README.md

File metadata and controls

64 lines (45 loc) · 2.12 KB

⛔ DEPRECATED ⛔

This repository is no longer being maintained. Further developments to this repository can be made by forking the project.

Serverless JSON Environment Plugin

No Maintenance Intended serverless npm version npm downloads license

Merge a JSON file with your provider or functions environment objects.

Requirements:

  • Serverless v1.12.x or higher.
  • AWS provider

How it works

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.

Setup

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 Serverless serverless.yml:
plugins:
  - serverless-plugin-jsonenv
  • Add environmentJSON: ${s3:myBucket/myEnvironment.json} property to provider or function:
provider:
  environmentJSON: ${s3:myBucket/providerEnvironment.json}
functions:
  hello:
    environmentJSON: ${s3:myBucket/helloEnvironment.json}
  • All done! JSON Environment will run on SLS deploy and invoke local commands

Contribute

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

License

This software is released under the MIT license. See the license file for more details.