# Lambda triggered by CloudWatch Event when SQS queue is empty/full

**URL:** <https://forum.serverless.com/t/lambda-triggered-by-cloudwatch-event-when-sqs-queue-is-empty-full/5718>\
**Category:** Serverless Framework\
**Created:** [September 7, 2018, 8:26pm UTC](https://forum.serverless.com/t/lambda-triggered-by-cloudwatch-event-when-sqs-queue-is-empty-full/5718 "2018-09-07T20:26:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrhamm](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/andrhamm/32/850_2.png) [@andrhamm](https://forum.serverless.com/u/andrhamm)\
**Post date:** [September 7, 2018, 8:26pm UTC](https://forum.serverless.com/t/lambda-triggered-by-cloudwatch-event-when-sqs-queue-is-empty-full/5718/1 "2018-09-07T20:26:57Z")

</div>

Could anybody share an example of a Lambda function configured to be triggered when an SQS queue becomes empty for say, 10 minutes, and when the queue is non-empty? I want to scale my DynamoDb table’s provisioned capacity units (I have a job that fills a queue once a day and once the queue is drained I don’t need write capacity until the job starts the next day).

Thanks in advance.
