fix lambda name generation

This commit is contained in:
doapp-ryanp 2015-09-21 09:57:31 -05:00
parent 56bc47ea00
commit c7afad9e18

View File

@ -212,7 +212,10 @@ module.exports.generateLambdaName = function(awsmJson) {
var handlerName = awsmJson.lambda.cloudFormation.Handler.replace('aws_modules', ''),
resourceAction = handlerName.substr(0, handlerName.lastIndexOf('/'));
return 'l' + resourceAction.replace(/\/([a-z])/g, function(g) {
//We prefix with an l to make sure the CloudFormation resource map index is unique
//we will probably have API gateway resources in their own CF JSON but we dont want to
//make that decsision until CF has API gateway support
return 'l' + resourceAction.replace(/(\/|-|_)([a-z])/g, function(g) {
return g[1].toUpperCase();
});
};