AWS RDS Creation Notification Mail using lambda function

64 Views Asked by At

I have to send a mail to the support team in my organization whenever the RDS databases are created right now I am using the lambda function which is getting triggered by the eventbridge rule through CreateDBInstance event but the ask is I want to send a mail only when the database is in available state. I have multiple accounts which the users would be spinning up multiple databses is there any efficient way that I can send the mail only when the database status is available.

I have created a lambda function which is getting triggered by a eventbridge rule but it is sending when the rds database is still in the creating process.

1

There are 1 best solutions below

2
On

Instead of setting a single rule, why not set EventBridge Cron job, in which it invokes a Lambda function, which polls the RDS status. Should it not be ready, the Lambda simply quits.

When RDS is finally up, Lambda sends the email and then deletes the EventBridge Cron job.

https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html