Skip to content

Commit dbae1dd

Browse files
committed
chore: do not store internal content on serverless.variables
1 parent bf7e2bd commit dbae1dd

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

dist/serverless-ssm-fetch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var SsmFetch = function () {
8181
var self = _this2;
8282

8383
// Init serverless variable that will store fetched data
84-
_this2.serverless.variables.serverlessSsmFetch = {};
84+
_this2.serverless.serverlessSsmFetch = {};
8585

8686
// For each SSM parameters to retrieve
8787
Object.keys(ssmParameters).forEach(function (parameter) {
@@ -105,7 +105,7 @@ var SsmFetch = function () {
105105
self.serverless.cli.log('> serverless-ssm-fetch: ' + err);
106106
reject(err);
107107
} else {
108-
self.serverless.variables.serverlessSsmFetch[parameter] = data.Parameter.Value;
108+
self.serverless.serverlessSsmFetch[parameter] = data.Parameter.Value;
109109
resolve(data);
110110
}
111111
});
@@ -115,7 +115,7 @@ var SsmFetch = function () {
115115
// Triggers all `getParameter` queries concurrently
116116
Promise.all(promiseCollection).then(function (success) {
117117
_this2.serverless.cli.log('> serverless-ssm-fetch: Get parameters success. Fetched SSM parameters:');
118-
_this2.serverless.cli.log(JSON.stringify(Object.keys(_this2.serverless.variables.serverlessSsmFetch)));
118+
_this2.serverless.cli.log(JSON.stringify(Object.keys(_this2.serverless.serverlessSsmFetch)));
119119
return resolve(success);
120120
}).catch(function (error) {
121121
_this2.serverless.cli.log('> serverless-ssm-fetch: Get parameter: ERROR');
@@ -133,7 +133,7 @@ var SsmFetch = function () {
133133
Object.keys(this.serverless.service.functions).forEach(function (functionName) {
134134
// Aliases of the current function path and the got ssm parameters path
135135
var currentFunction = _this3.serverless.service.functions[functionName];
136-
var fetchedSsmParameters = _this3.serverless.variables.serverlessSsmFetch;
136+
var fetchedSsmParameters = _this3.serverless.serverlessSsmFetch;
137137

138138
if (_this3.isSet(currentFunction.ssmToEnvironment)) {
139139
// If the property `ssmToEnvironment` has been set at the function level

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-ssm-fetch",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"main": "dist/serverless-ssm-fetch.js",
55
"description": "Sets \"AWS Systems Manager Parameter Store (SSM)\" parameters into functions' environment variables.",
66
"scripts": {

src/serverless-ssm-fetch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SsmFetch {
6565
let self = this;
6666

6767
// Init serverless variable that will store fetched data
68-
this.serverless.variables.serverlessSsmFetch = {};
68+
this.serverless.serverlessSsmFetch = {};
6969

7070
// For each SSM parameters to retrieve
7171
Object.keys(ssmParameters).forEach((parameter) => {
@@ -89,7 +89,7 @@ class SsmFetch {
8989
self.serverless.cli.log('> serverless-ssm-fetch: ' + err);
9090
reject(err);
9191
} else {
92-
self.serverless.variables.serverlessSsmFetch[parameter] = data.Parameter.Value;
92+
self.serverless.serverlessSsmFetch[parameter] = data.Parameter.Value;
9393
resolve(data);
9494
}
9595
});
@@ -102,7 +102,7 @@ class SsmFetch {
102102
Promise.all(promiseCollection)
103103
.then((success) => {
104104
this.serverless.cli.log('> serverless-ssm-fetch: Get parameters success. Fetched SSM parameters:');
105-
this.serverless.cli.log(JSON.stringify(Object.keys(this.serverless.variables.serverlessSsmFetch)));
105+
this.serverless.cli.log(JSON.stringify(Object.keys(this.serverless.serverlessSsmFetch)));
106106
return resolve(success);
107107
})
108108
.catch((error) => {
@@ -121,7 +121,7 @@ class SsmFetch {
121121
Object.keys(this.serverless.service.functions).forEach((functionName) => {
122122
// Aliases of the current function path and the got ssm parameters path
123123
let currentFunction = this.serverless.service.functions[functionName];
124-
let fetchedSsmParameters = this.serverless.variables.serverlessSsmFetch;
124+
let fetchedSsmParameters = this.serverless.serverlessSsmFetch;
125125

126126
if (this.isSet(currentFunction.ssmToEnvironment)) {
127127
// If the property `ssmToEnvironment` has been set at the function level

0 commit comments

Comments
 (0)