serverless-pseudo-parameters
Advanced tools
Comparing version 1.1.5 to 1.2.5
@@ -14,2 +14,3 @@ 'use strict'; | ||
}; | ||
this.skipRegionReplace = _.get(serverless.service, 'custom.pseudoParameters.skipRegionReplace', false) | ||
} | ||
@@ -20,3 +21,11 @@ | ||
const template = this.serverless.service.provider.compiledCloudFormationTemplate; | ||
const skipRegionReplace = this.skipRegionReplace; | ||
const consoleLog = this.serverless.cli.consoleLog; | ||
consoleLog(`${chalk.yellow.underline('AWS Pseudo Parameters')}`); | ||
if (skipRegionReplace) { | ||
consoleLog('Skipping automatic replacement of regions with account region!'); | ||
} | ||
// loop through all resources, and check all (string) properties for any #{AWS::} | ||
@@ -55,7 +64,7 @@ // reference. If found, replace the value with an Fn::Sub reference | ||
function replaceChildNodes(dictionary, name){ | ||
function replaceChildNodes(dictionary, name) { | ||
_.forEach(dictionary, function(value, key){ | ||
// if a region name is mentioned, replace it with a reference | ||
if(typeof value === 'string' && containsRegion(value)) { | ||
// if a region name is mentioned, replace it with a reference (unless we are skipping automatic replacements) | ||
if(typeof value === 'string' && !skipRegionReplace && containsRegion(value)) { | ||
var regionFinder = new RegExp(regions().join("|")); | ||
@@ -80,3 +89,3 @@ value = value.replace(regionFinder, '#{AWS::Region}'); | ||
// this.serverless.cli.consoleLog(message); | ||
console.info('AWS Pseudo Parameter: ' + msg) | ||
consoleLog('AWS Pseudo Parameter: ' + msg) | ||
} | ||
@@ -83,0 +92,0 @@ } while (m); |
{ | ||
"name": "serverless-pseudo-parameters", | ||
"version": "1.1.5", | ||
"version": "1.2.5", | ||
"devDependencies": {}, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5546
82