/slsenv

Loads .env into serverless.yml

Primary LanguageJavaScript

SLSENV

Load the contents of .env into serverless.yml (Serverless Component V2).

Install

$ npm i -g slsenv

Run

In project root folder which has .env and serverless.yml, run:

$ slsenv

Changes are write back to serverless.yml.

Config

Create .slsenvrc in project root folder

{
  "path": "inputs.functionConf.environment",
  "excludes": ["TENCENT_SECRET_ID", "TENCENT_SECRET_KEY"]
}
  • path: key path to environment variables
  • excludes: excluded .env variables