bradmurray / DynamoDBLambdaMonitor

Monitor DynamoDB with Lambda to increase and decrease throughput as needed
GNU General Public License v3.0
19 stars 1 forks source link

Use DynamoDb cloud watch events? #1

Open bakura10 opened 8 years ago

bakura10 commented 8 years ago

Hi,

CloudWatchZvenrs was launched a few days ago and it allows to trigger a lambda function based on metrics. Maybe that is a better way to do rather than using the scheduled invoke?

bakura10 commented 8 years ago

Also as I suspect cloud watch events send the table name, the Lambda could be rewrite to work with any Dynamodb tables, not only a specified one :)

analytically commented 8 years ago

:+1:

bakura10 commented 8 years ago

After checking CloudWatch Event it seems that it does not support that yet.

However, maybe that a better way instead of polling would be to:

  1. Create a SNS topic (by default DynamoDB creates one).
  2. All CloudWatch events are configured to send message to the topic:
capture d ecran 2016-01-25 a 11 26 38
  1. Attach the SNS topic to the Lambda function, so that whenever an alarm status change, the Lambda function is executed, and can perform its scaling operation.

Of course it would requires changes to the Lambda as it would need to be able to work with multiple tables (but maybe this Lambda could itself requires the creation of a DynamoDB tables that would keep track of how many times a specific table was updated in a day).