diff --git a/README.md b/README.md index 55f2f6b..23776c8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ Enables Coudwatch logging for API Gateway events ```yaml ... +custom: + stageVariables: + thirdPartyEndpoint: http://supercool.endpoint.com/openapi/something + + plugins: - serverless-enable-api-logs diff --git a/src/index.js b/src/index.js index 656f055..8ed2712 100644 --- a/src/index.js +++ b/src/index.js @@ -18,12 +18,13 @@ module.exports = Class.extend({ const template = this._serverless.service.provider.compiledCloudFormationTemplate; // setup variables, if any are defined - /* + var variables = {}; - if (this._serverless.service.custom.stageVariables) { + + if (this._serverless.service.custom && this._serverless.service.custom.stageVariables) { variables = this._serverless.service.custom.stageVariables; } -*/ + // find the correct stage name var stage = this._serverless.service.defaults.stage; @@ -51,7 +52,8 @@ module.exports = Class.extend({ LoggingLevel: "INFO", ResourcePath: "/*", MetricsEnabled: true - }] + }], + Variables: variables } }