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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
s-resources-cf.json
file.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);
;