# Conditional serverless.yml based on stage?

**URL:** <https://forum.serverless.com/t/conditional-serverless-yml-based-on-stage/1763>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [April 25, 2017, 7:59pm UTC](https://forum.serverless.com/t/conditional-serverless-yml-based-on-stage/1763 "2017-04-25T19:59:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![buggy](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/buggy/32/177_2.png) [@buggy](https://forum.serverless.com/u/buggy)\
**Post date:** [April 25, 2017, 11:33pm UTC](https://forum.serverless.com/t/conditional-serverless-yml-based-on-stage/1763/2 "2017-04-25T23:33:26Z")

</div>

Conditional logic isn’t supported.

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

```auto
custom:
  enabled:
    dev: false
    prod: true

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

```

---

_[View the full topic](https://forum.serverless.com/t/conditional-serverless-yml-based-on-stage/1763)._
