Send a Notification after a new Database creation on AWS

Viewed 44

I want to get a notification when a new Database gets created on AWS Aurora by another application. But all notifications are on the Cluster or instance level. any help would be appreciated.

1 Answers

Currently there is no metric like "number of databases" available, but for security reason, it is also not best practice for AWS, because getting the number of databases means, you have to provide AWS your database credentials.

What I would prefer (without any large costs) is to write a simple AWS Lambda, which queries all x minutes your database and write the number of available databases into Cloudwatch Metric. As soon as the number of databases is changing, you can trigger a SNS based on that metric.

Possible setup:

  • Create AWS Lambda
  • Provide your credentials for the Aurora Cluster as environment variables
  • Lambda connects during initalizing to the database
  • query the number of databases
  • run put_metric to store this number to Cloudwatch Metrics
  • attach a SNS to the Cloudwatch Metric which will send a notification on every change.
Related