This project automates the process of creating daily manual snapshots for an Amazon RDS instance and monitors its health using CloudWatch alarms. All infrastructure is provisioned using Terraform.
Ensure data durability and availability by:
- Automatically backing up RDS databases daily
- Monitoring critical metrics like CPU usage
- Alerting via email when thresholds are breached
- Amazon RDS – Free-tier MySQL instance with automated and manual backups
- Amazon S3 – Stores snapshot metadata logs
- AWS Lambda – Automates manual snapshot creation and log storage
- Amazon EventBridge – Triggers Lambda on a daily schedule
- Amazon CloudWatch – Monitors RDS health metrics
- Amazon SNS – Sends email notifications
- Amazon SES (optional) – For branded/custom email notifications
rds-backup-monitoring/ ├── main.tf # Main infrastructure components ├── variables.tf # Input variables ├── outputs.tf # Output values ├── iam.tf # IAM roles and policies for Lambda ├── lambda/ │ ├── snapshot_lambda.py # Python Lambda code for RDS snapshot and logging │ └── snapshot_lambda.zip
- ✅ Daily RDS snapshot triggered by EventBridge
- ✅ Logs snapshot metadata to S3
- ✅ CloudWatch alarm for high CPU usage
- ✅ SNS email alert to notify admins
- ✅ All infrastructure managed via Terraform
- Clone the Repo
git clone https://github.com/yourusername/rds-backup-monitoring.git cd rds-backup-monitoring - Configure AWS Credentials aws configure
- Zip the Lambda Function cd lambda zip snapshot_lambda.zip snapshot_lambda.py cd ..
- Initialize Terraform terraform init
- Apply Infrastructure terraform plan -out=tfplan terraform apply tfplan
- Confirm Email Subscription Check your inbox for an SNS confirmation email Click "Confirm Subscription"
🧪 Optional Enhancements Add snapshot retention logic (e.g., delete after 7 days) Include multi-metric CloudWatch dashboards Integrate with SES for rich HTML email alerts Trigger snapshot on-demand via API Gateway
📬 Pro Tip: Use Crosslinks This repo shows the automated Terraform version of my blog post. Want to see the manual setup step-by-step? 👉 Read the full guide on Medium
🧑💻 Author Jermaine Brewer Founder of JB Consulting | Cloud Engineer @ JBrewInTheCloud.com
Let’s connect on LinkedIn - Jermaine Brewer