From 8fa0ebc10e8f4f2e70444f45d70ceae41441c533 Mon Sep 17 00:00:00 2001 From: Franziska Schmidt Date: Thu, 12 Jul 2018 15:27:00 +0200 Subject: [PATCH 1/3] Validate with region. --- bin/validate-template.js | 4 +++- lib/validate.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/validate-template.js b/bin/validate-template.js index dd3e807..b147eac 100755 --- a/bin/validate-template.js +++ b/bin/validate-template.js @@ -4,8 +4,10 @@ var cloudfriend = require('..'); var templatePath = process.argv[2]; +var region = process.argv[3] || 'us-east-1'; +console.log(region); -cloudfriend.validate(templatePath, 'us-east-1') +cloudfriend.validate(templatePath, region) .then(function() { console.log('✔ valid'); }).catch(function(err) { diff --git a/lib/validate.js b/lib/validate.js index 2b5ff73..6299b0a 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -13,7 +13,7 @@ var build = require('./build'); * reject if it is not. */ module.exports = (templatePath, region) => { - var cfn = new AWS.CloudFormation({ region: region || 'us-east-1' }); + var cfn = new AWS.CloudFormation({ region: region}); return build(templatePath).then(function(template) { return cfn.validateTemplate({ TemplateBody: JSON.stringify(template) }).promise(); From 357546bdaf0b3c5c13f2012f5285997019b2281c Mon Sep 17 00:00:00 2001 From: Franziska Schmidt Date: Thu, 12 Jul 2018 15:39:18 +0200 Subject: [PATCH 2/3] fix tests. --- lib/validate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validate.js b/lib/validate.js index 6299b0a..2b5ff73 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -13,7 +13,7 @@ var build = require('./build'); * reject if it is not. */ module.exports = (templatePath, region) => { - var cfn = new AWS.CloudFormation({ region: region}); + var cfn = new AWS.CloudFormation({ region: region || 'us-east-1' }); return build(templatePath).then(function(template) { return cfn.validateTemplate({ TemplateBody: JSON.stringify(template) }).promise(); From 2d8c4d82c6187a2ecede12ec56e89661a5f95d6e Mon Sep 17 00:00:00 2001 From: Franziska Schmidt Date: Thu, 12 Jul 2018 15:41:46 +0200 Subject: [PATCH 3/3] remove console.log --- bin/validate-template.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/validate-template.js b/bin/validate-template.js index b147eac..d852d21 100755 --- a/bin/validate-template.js +++ b/bin/validate-template.js @@ -5,7 +5,6 @@ var cloudfriend = require('..'); var templatePath = process.argv[2]; var region = process.argv[3] || 'us-east-1'; -console.log(region); cloudfriend.validate(templatePath, region) .then(function() {