Skip to content

Add stage variables for Serverless 1.x to ApiGateway, so you can use variables in your Lambda's

License

Notifications You must be signed in to change notification settings

svdgraaf/serverless-plugin-stage-variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

Add stage variables for Serverless 1.x to ApiGateway, so you can use variables in your Lambda's

Resources

License

Stars

Watchers

Forks

Packages

No packages published