Skip to content

Commit

Permalink
Fix GH-17 variables do not get expanded
Browse files Browse the repository at this point in the history
These point to the solution:

* https://forum.serverless.com/t/serverless-plugin-resolving-variable-references/2233/2
* https://github.com/serverless/serverless/pull/3911/files

TL;DR: dschep wrote "Serverless changed it’s behavior a few releases
ago. That variable substitution is not called by the time plugin
constructors get called. Unless you actually need it then, just access
it in your lifecycle hooks, it’ should be resolved by then."
  • Loading branch information
shentonfreude committed Jan 26, 2018
1 parent 60f1d88 commit 2336df6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const regionToUrlRootMap = region => ({
class Client {
constructor(serverless, options){
this.serverless = serverless;
this.stage = options.stage || _.get(serverless, 'service.provider.stage')
this.region = options.region || _.get(serverless, 'service.provider.region');
this.provider = 'aws';
this.aws = this.serverless.getProvider(this.provider);

Expand Down Expand Up @@ -65,6 +63,8 @@ class Client {
},

'client:deploy:deploy': () => {
this.stage = options.stage || _.get(serverless, 'service.provider.stage')
this.region = options.region || _.get(serverless, 'service.provider.region');
this._validateAndPrepare()
.then(this._processDeployment.bind(this));
},
Expand Down

0 comments on commit 2336df6

Please sign in to comment.