@resourcefulhumans/update-lambda-environment-config

1.1.0 • Public • Published

update-lambda-environment-config

npm version Build Status monitored by greenkeeper.io js-standard-style semantic-release

This script takes the output of aws lambda get-function-configuration and returns an updated environment configuration string with added version, deployTime and node environment from environment variables.

Example

Given this is the configuration for your lambda:

{ 
   "FunctionName": "myLambdaFunction", 
   … 
   "Environment": { 
       "Variables": { 
           "FOO": "BAR" 
       } 
    } 
} 

If called like this:

$ VERSION=1.2.3
$ DEPLOY_TIME=1234567890
$ NODE_ENV=production
$ VARS=`aws lambda get-function-configuration \
--function-name myLambdaFunction \
| ./node_modules/.bin/update-lambda-environment-config`

it sets $VARS to this

FOO="BAR",VERSION="1.2.3",DEPLOY_TIME="1234567890",NODE_ENV="production"

which can be used for updating it via aws lambda update-function-configuration:

aws lambda update-function-configuration \
--function-name "myLambdaFunction" \
--environment "Variables={$(VARS)}"

See it in action here.

Readme

Keywords

Package Sidebar

Install

npm i @resourcefulhumans/update-lambda-environment-config

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • resourcefuldevelopers
  • dam1r89