DynamoDBLambdaMonitor icon indicating copy to clipboard operation
DynamoDBLambdaMonitor copied to clipboard

Use DynamoDb cloud watch events?

Open bakura10 opened this issue 9 years ago • 3 comments

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 avatar Jan 22 '16 12:01 bakura10

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 :)

bakura10 avatar Jan 22 '16 12:01 bakura10

:+1:

analytically avatar Jan 25 '16 10:01 analytically

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).

bakura10 avatar Jan 25 '16 10:01 bakura10