# Deploying DDB stream events to specific stage with v1

**URL:** <https://forum.serverless.com/t/deploying-ddb-stream-events-to-specific-stage-with-v1/595>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [October 19, 2016, 8:52pm UTC](https://forum.serverless.com/t/deploying-ddb-stream-events-to-specific-stage-with-v1/595 "2016-10-19T20:52:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adambiggs](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/adambiggs/32/235_2.png) [@adambiggs](https://forum.serverless.com/u/adambiggs)\
**Post date:** [October 19, 2016, 8:52pm UTC](https://forum.serverless.com/t/deploying-ddb-stream-events-to-specific-stage-with-v1/595/1 "2016-10-19T20:52:33Z")

</div>

I have a v0.5 function that backs up DyanmoDB records to S3, and I’m in the process of migrating it to Serverless v1. But I’m confused with how to properly deploy this function…

In v0.5 my team could deploy the function to any stage, but the DynamoDB stream events were only deployed to our `prod` stage. But now that there’s no separate command to deploy the events, will the events get deployed to every stage along with the function?

I need to make sure that when DDB fires a stream event, only the function in the `prod` stage is triggered.

Is this currently possible with Serverless v1?

---

<div class="post-metadata">

**Author:** ![johncmckim](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/johncmckim/32/27_2.png) [@johncmckim](https://forum.serverless.com/u/johncmckim)\
**Post date:** [October 21, 2016, 6:08am UTC](https://forum.serverless.com/t/deploying-ddb-stream-events-to-specific-stage-with-v1/595/2 "2016-10-21T06:08:04Z")

</div>

@adambiggs I assume you don’t share the DynamoDB table across stages? If not, you can have different instances of your lambda connected to each tables stream.

You can use the solution I describe here - [Disable Function Per Stage?](http://forum.serverless.com/t/disable-function-per-stage/604/6?u=johncmckim). But you run the same risks by only ever executing the code in production.

---

<div class="post-metadata">

**Author:** ![adambiggs](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/adambiggs/32/235_2.png) [@adambiggs](https://forum.serverless.com/u/adambiggs)\
**Post date:** [October 21, 2016, 11:05pm UTC](https://forum.serverless.com/t/deploying-ddb-stream-events-to-specific-stage-with-v1/595/3 "2016-10-21T23:05:27Z")

</div>

Thanks for the reply @johncmckim. That’s what I ended up doing.

I set up a `SERVERLESS_STAGE` variable using the `serverless-plugin-write-env-vars` plugin, and then simply return from the function without doing anything if the variable != `'prod'`.

Seems like a bit of an inefficient solution… But it works.
