Skip to content

zaru/serverless-plugin-embedded-env-in-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

serverless npm version License: MIT

Embedded env in Code

ServerlessFramework Plugin

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`

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published