serverless/serverless-helpers-js

Name: serverless-helpers-js

Owner: Serverless

Description: Serverless Helpers Node.Js: An NPM module that provides helper functions for Serverless Modules written in Node.js -

Created: 2015-12-07 14:52:47.0

Updated: 2017-09-01 17:04:24.0

Pushed: 2016-09-13 10:37:45.0

Homepage: http://serverless.com

Size: 13

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Serverless Helpers (Node.js Version)

serverless

Currently unmaintained

At the moment this library is unmaintained, we're going to take another look at it after we've release V1 of the Framework to evaluate how we should support it in the future.

Features
CF Output variables

To have your lambda access the CF output variables you have to give it the cloudformation:describeStacks access rights in the lambda IAM role.

The CF.loadVars() promise will add all CF output variables to the process' environment as SERVERLESS_CF_OutVar name. It will add a few ms to the startup time of your lambda.

Change your lambda handler as follows:

equire Serverless ENV vars
ServerlessHelpers = require('serverless-helpers-js');
erlessHelpers.loadEnv();

equire Logic
lib = require('../lib');

ambda Handler
le.exports.handler = function(event, context) {
rverlessHelpers.CF.loadVars()
hen(function() {
lib.respond(event, function(error, response) {
  return context.done(error, response);
});

atch(function(err) {
return context.done(err, null);
;


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.