Conditional serverless.yml based on stage?

Conditional logic isn’t supported.

If you know all of the environments you’re deploying to then you could do something like:

custom:
  enabled:
    dev: false
    prod: true

enabled: ${self:custom.enabled.${opt:stage, self:provider.stage}}
9 Likes