Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinchisholm/65d6566a4d01d3971b0a367c0b899538 to your computer and use it in GitHub Desktop.
Save kevinchisholm/65d6566a4d01d3971b0a367c0b899538 to your computer and use it in GitHub Desktop.
service: my-service
plugins:
- serverless-plugin-ifelse
provider:
name: aws
runtime: nodejs12.x
stage: ${opt:stage, "dev"}
environment:
staticMessage: "this is a static message"
custom:
serverlessIfElse:
- If: '"${self:provider.stage}" === "prod"'
Set:
provider.environment.dynamicMessage: "this is a dynamic PROD message"
ElseSet:
provider.environment.dynamicMessage: "this is a dynamic DEV/TEST message"
functions:
fooFunction:
handler: foo-function.handler
events:
- http:
path: foo
method: get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment