File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,29 @@ class AwsAlias {
35
35
*/
36
36
this . _stage = this . _provider . getStage ( ) ;
37
37
this . _alias = this . _options . alias || this . _stage ;
38
+
39
+ /**
40
+ * (new) register custom variable source--preferred method to define
41
+ * plugin variables
42
+ * @see https://www.serverless.com/framework/docs/guides/plugins/custom-variables
43
+ */
44
+ this . configurationVariablesSources = {
45
+ awsAlias : {
46
+ resolve : async ( { address } ) =>
47
+ address === 'alias' ? { value : this . _alias } : null ,
48
+ } ,
49
+ } ;
50
+
51
+ /**
52
+ * register alias property with provider schema to maintain old
53
+ * functionality while meeting new variable resolution standards
54
+ */
55
+ this . _serverless . configSchemaHandler . schema . properties . provider . properties . alias =
56
+ { type : 'string' } ;
57
+
58
+ /**
59
+ * (old/bad) set alias property
60
+ */
38
61
this . _serverless . service . provider . alias = this . _alias ;
39
62
40
63
/**
@@ -86,12 +109,14 @@ class AwsAlias {
86
109
alias : {
87
110
usage : 'Name of the alias' ,
88
111
shortcut : 'a' ,
89
- required : true
112
+ required : true ,
113
+ type : 'string'
90
114
} ,
91
115
verbose : {
92
116
usage : 'Enable verbose output' ,
93
117
shortcut : 'v' ,
94
- required : false
118
+ required : false ,
119
+ type : 'boolean'
95
120
}
96
121
}
97
122
}
Original file line number Diff line number Diff line change 12
12
"eslint" : " node node_modules/eslint/bin/eslint.js --ext .js lib"
13
13
},
14
14
"author" :
" Frank Schmid <[email protected] >" ,
15
+ "contributors" : [
16
+ {
17
+ "name" : " Robbie Nichols" ,
18
+
19
+ }
20
+ ],
15
21
"nyc" : {
16
22
"exclude" : [
17
23
" test/**/*.*"
30
36
"os" : " ^0.1.1" ,
31
37
"semver" : " ^7.3.4"
32
38
},
39
+ "peerDependencies" : {
40
+ "serverless" : " ^2.72.3"
41
+ },
33
42
"devDependencies" : {
34
43
"chai" : " ^4.2.0" ,
35
44
"chai-as-promised" : " ^7.1.1" ,
You can’t perform that action at this time.
0 commit comments