serverless-plugin-stage-variables
Advanced tools
Comparing version 1.0.3 to 1.2.3
@@ -18,3 +18,3 @@ { | ||
"name": "serverless-plugin-stage-variables", | ||
"version": "1.0.3" | ||
"version": "1.2.3" | ||
} |
@@ -18,15 +18,20 @@ 'use strict'; | ||
addStageVariables: function() { | ||
var template = this._serverless.service.provider.compiledCloudFormationTemplate; | ||
const template = this._serverless.service.provider.compiledCloudFormationTemplate; | ||
config = { | ||
StageName: 'Foobar', | ||
// setup variables, if any are defined | ||
var variables = {}; | ||
if (this._serverless.service.custom.stageVariables) { | ||
variables = this._serverless.service.custom.stageVariables; | ||
} | ||
// create a config for the stage | ||
var config = { | ||
StageName: this._serverless.service.provider.stage, | ||
StageDescription: { | ||
StageName: 'Foobar', | ||
Variables: { | ||
"Foo": "Bar" | ||
} | ||
StageName: this._serverless.service.provider.stage, | ||
Variables: variables, | ||
} | ||
} | ||
// find the deployment, and add the stage variables | ||
// find the deployment resource, and add the stage variables | ||
Object.keys(template.Resources).forEach(function(key){ | ||
@@ -38,4 +43,4 @@ if (template.Resources[key]['Type'] == 'AWS::ApiGateway::Deployment') { | ||
console.log(template.Resources); | ||
this._serverless.cli.log('Merged stage variables into ApiGateway Deployment'); | ||
}, | ||
}); |
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
2276
35