Comparing version 0.3.1 to 0.3.2
@@ -8,2 +8,4 @@ 'use strict'; | ||
exports.default = function () { | ||
var _this = this; | ||
if (this.aws_profile) { | ||
@@ -16,9 +18,38 @@ _awsSdk2.default.config.credentials = new _awsSdk2.default.SharedIniFileCredentials({ | ||
var cf = new _awsSdk2.default.CloudFormation({ | ||
region: this.aws_region || 'us-east-1' | ||
region: this.aws_region || 'us-east-1', | ||
paramValidation: false | ||
}); | ||
var params = []; | ||
Object.keys(this._params).forEach(function (p) { | ||
var key = p + 'Param'; | ||
_this._stack.Parameters[key] = { | ||
Type: 'String', | ||
NoEcho: _this.hiddenParams | ||
}; | ||
if (_this._params[p]) { | ||
params.push({ ParameterKey: key, ParameterValue: _this._params[p] }); | ||
} else { | ||
_this._stack.Parameters[key].UsePreviousValue = true; | ||
} | ||
}); | ||
if (this.envParam) { | ||
this._stack.Parameters.envParam = { | ||
Type: 'String' | ||
}; | ||
params.push({ | ||
ParameterKey: 'envParam', | ||
ParameterValue: process.env.NODE_ENV | ||
}); | ||
} | ||
var payload = { | ||
StackName: this._name, | ||
TemplateBody: JSON.stringify(this._stack), | ||
Capabilities: ['CAPABILITY_NAMED_IAM'] | ||
Capabilities: ['CAPABILITY_NAMED_IAM'], | ||
Parameters: params | ||
}; | ||
@@ -25,0 +56,0 @@ |
@@ -102,2 +102,6 @@ 'use strict'; | ||
param: function param(id, opts) { | ||
return intrinsics.ref(id + 'Param', opts); | ||
}, | ||
output: function output(id, value) { | ||
@@ -104,0 +108,0 @@ var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
@@ -52,7 +52,11 @@ 'use strict'; | ||
if (opts.appendEnvName) { | ||
this._params = opts.params || {}; | ||
this.envParam = opts.envParam !== undefined ? opts.envParam : false; | ||
this.hiddenParams = opts.hiddenParams !== undefined ? opts.hiddenParams : false; | ||
if (opts.appendEnv) { | ||
if (process.env.NODE_ENV) { | ||
this._name += '--' + process.env.NODE_ENV; | ||
} else { | ||
(0, _emit.warn)('"appendEnvName" is set to true, but environment was not found!'); | ||
(0, _emit.warn)('"appendEnv" is set to true, but environment was not found!'); | ||
} | ||
@@ -63,13 +67,17 @@ } | ||
Mappings: {}, | ||
Conditions: {}, | ||
Resources: {}, | ||
Outputs: {} | ||
Outputs: {}, | ||
Parameters: {} | ||
}; | ||
this.addMapping = function (data) { | ||
return _this._add('Mappings', data); | ||
}; | ||
this.addCondition = function (data) { | ||
return _this._add('Conditions', data); | ||
}; | ||
this.addResource = function (data) { | ||
return _this._add('Resources', data); | ||
}; | ||
this.addMapping = function (data) { | ||
return _this._add('Mappings', data); | ||
}; | ||
this.addOutput = function (data) { | ||
@@ -81,2 +89,3 @@ return _this._add('Outputs', data); | ||
this.aws_region = opts.region; | ||
this.apply = _cloudformation2.default; | ||
@@ -83,0 +92,0 @@ } |
{ | ||
"name": "axe", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Create AWS infrastructure with Javascript", | ||
@@ -5,0 +5,0 @@ "author": "Jason Maurer", |
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
28081
616
5