serverless-plugin-stage-variables

1.10.1 • Public • Published

serverless-plugin-stage-variables

Add stage variables for Serverless 1.x to ApiGateway, so you can use variables (and CloudFormation references!) in your Lambda's.

Usage

custom:
  stageVariables:
    bucket_name: ${env.BUCKET_NAME}
    endpoint: { "Fn::GetAtt": "CloudFrontEndpoint.DomainName" }
    foo: bar

plugins:
  - serverless-plugin-stage-variables

And then in your lambda's, you can use:

module.exports.foobar = (event, context, cb) => {
  // event.stageVariables.bucket_name
  // event.stageVariables.endpoint
  // event.stageVariables.foo
}

Readme

Keywords

none

Package Sidebar

Install

npm i serverless-plugin-stage-variables

Weekly Downloads

4,347

Version

1.10.1

License

MIT

Unpacked Size

4.89 kB

Total Files

4

Last publish

Collaborators

  • medikoo
  • svdgraaf
  • pgrzesik