serverless-plugin-embedded-env-in-code

Replace environment variables with static strings before deployment. It is for Lambda @ Edge.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
serverless-plugin-embedded-env-in-code
920.1.04 years ago4 years agoMinified + gzip package size for serverless-plugin-embedded-env-in-code in KB

Readme

ServerlessFramework Plugin

Embedded env in Code

This plugin will replace environment variables with static strings before deployment. It’s for Lambda@Edge.

Usage

serverless.yml
functions:
  foobar:
    handler: foobar.perform
    embedded:
      files:
        - foobar.js
        - foobar-lib.js
      variables:
        FooBar: somethingA
        BarBaz: somethingB

For example
const foobar = process.env.FooBar
const barbaz = `${process.env.BarBaz} <= barbaz`

replaces
const foobar = 'somethingA'
const barbaz = `somethingB <= barbaz`