🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

serverless-plugin-stage-variables

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-stage-variables - npm Package Compare versions

Comparing version

to
1.2.3

2

package.json

@@ -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');
},
});