Trigger an AWS Lambda function from Amazon RDS for MySQL or Amazon RDS for MariaDB using audit logs and Amazon CloudWatch
Database Blog
This article explains how to invoke AWS Lambda functions from Amazon RDS for MySQL or RDS for MariaDB database instances using their audit logs and Amazon CloudWatch.
Specifically, the article covers:
- Solution overview and architecture diagram
- Prerequisites for the solution
- Creating a table in the database to trigger the Lambda function
- Enabling audit logs on the RDS instance
- Publishing the audit logs to a CloudWatch log group
- Creating the Lambda function to process the audit log data
- Creating a CloudWatch subscription filter to trigger the Lambda on specific log events
- Verifying the solution is working
- Tips and troubleshooting
- Cleaning up the deployed resources
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
Feb 5
2026
2026
Trigger AWS Lambda functions from Amazon RDS for SQL Server database events
Mar 20
2024
2024
Unlocking efficiency: Integrate AWS Lambda with Amazon RDS for Oracle to automate custom script operations
Nov 25
2024
2024
Run event-driven stored procedures with AWS Lambda for Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL
Jan 21
2026
2026
Automate the export of Amazon RDS for MySQL or Amazon Aurora MySQL audit logs to Amazon S3 with batching or near real-time processing
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.