serverless-leo
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -10,11 +10,15 @@ 'use strict'; | ||
const stage = this.serverless.service.custom.stage; | ||
const custom = this.serverless.service.custom[stage] ? this.serverless.service.custom[stage] : this.serverless.service.custom | ||
const cloudformation = this.serverless.service.provider.compiledCloudFormationTemplate | ||
const customInstall = { | ||
"Type": "Custom::Install", | ||
"Properties": { | ||
"ServiceToken": { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": `${this.serverless.service.custom[stage].leoStack || this.serverless.service.custom.leoStack}-Register` | ||
} | ||
}, | ||
"Properties": {} | ||
} | ||
if (custom.leoRegister) { | ||
customInstall.Properties.ServiceToken = custom.leoRegister | ||
} else { | ||
customInstall.Properties.ServiceToken = { | ||
"Fn::ImportValue": { | ||
"Fn::Sub": `${custom.leoStack}-Register` | ||
} | ||
} | ||
@@ -21,0 +25,0 @@ } |
@@ -9,2 +9,3 @@ 'use strict'; | ||
const stage = this.provider.getStage() | ||
const custom = this.serverless.service.custom[stage] ? this.serverless.service.custom[stage] : this.serverless.service.custom | ||
@@ -20,6 +21,17 @@ _.forEach(this.serverless.service.functions, (functionObject, functionName) => { | ||
if (streams.length && (!this.serverless.service.custom || (!this.serverless.service.custom.leoStack && !this.serverless.service.custom[stage].leoStack))) { | ||
throw new Error(`Leo streams require the custom "leoStack" variable in the serverless yml. Optionally under custom[stage]`) | ||
if (!streams.length) { | ||
return { | ||
streams, | ||
} | ||
} | ||
if (!this.serverless.service.custom) { | ||
throw new Error(`Leo streams require custom variables. Please verify your serverless.yml.`) | ||
} | ||
if (!custom.leoStack && !custom.leoRegister) { | ||
throw new Error(`Leo streams require the custom "leoStack" or "leoRegister" variable. Optionally under custom[stage]. Please verify your serverless.yml.`) | ||
} | ||
return { | ||
@@ -26,0 +38,0 @@ streams, |
{ | ||
"name": "serverless-leo", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Serverless plugin for leo microservices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
6279
5
108
1
34