From bfcc1c68c3a0e88e4c021f16d85285a3c250f687 Mon Sep 17 00:00:00 2001 From: leoalves Date: Thu, 12 Nov 2015 01:45:41 -0500 Subject: [PATCH] Update S3 Bucket Name in the CloudFormation blueprint with the Stack Name --- lib/aws/cloud-formation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/aws/cloud-formation.js b/lib/aws/cloud-formation.js index 46719c6..9c3bc27 100644 --- a/lib/aws/cloud-formation.js +++ b/lib/aws/cloud-formation.js @@ -17,7 +17,9 @@ CloudFormation.prototype.createStack = function(name, templatePath) { return fsp.readFile(templatePath) .then(function(template) { - template = template.toString(); + var newTemplate = JSON.parse(template); + newTemplate.Resources.LambdaFunction.Properties.Code.S3Bucket = name; + template = JSON.stringify(newTemplate).toString(); debug('creating stack; name=', name, '; template=', template);