Skip to content

devsecops-studio/terraform-aws-rds-event-notification

Repository files navigation

AWS RDS Event Notification Module

This Terraform module configures Amazon RDS event notifications and forwards them to a Slack channel through a webhook URL. It helps you stay informed about important RDS events for both database instances and clusters.

Check out the blog post about the motivation behind this module: Implementing RDS Event Notification with Terraform

Features

  • Monitors RDS instance and cluster events
  • Sends notifications to Slack via webhook
  • Configurable event categories for both instances and clusters
  • Supports multiple RDS instances and clusters
  • Uses AWS SNS for reliable message delivery

Usage

module "rds_notifications" {
  source = "devsecops-studio/rds-event-notification/aws"

  name          = "rds-notifications"
  slack_webhook = var.slack_webhook_url
  
  # RDS instances to monitor
  db_instance_ids = ["db-instance-1", "db-instance-2"]
  
  # RDS clusters to monitor
  db_cluster_ids  = ["db-cluster-1"]
  
  tags = {
    Environment = "production"
    Terraform   = "true"
  }
}

Notification screenshot

  • DB instance failover failover

  • DB instance failover shutdown

  • DB instance failover completed failover-completed

Requirements

Name Version
terraform >= 1.0
aws >= 5.55

Providers

Name Version
aws >= 5.55

Modules

Name Source Version
slack_notifier_function terraform-aws-modules/lambda/aws 7.7.1

Resources

Name Type
aws_db_event_subscription.db_cluster resource
aws_db_event_subscription.instances resource
aws_sns_topic.this resource
aws_sns_topic_subscription.slack_notifier_function resource

Inputs

Name Description Type Default Required
create wheter or not to create resources bool true no
db_cluster_event_categories List of event categories for RDS cluster instances list(string)
[
"configuration change",
"failover",
"failure",
"maintenance"
]
no
db_cluster_ids List of RDS cluster instances to monitor list(string) [] no
db_instance_event_categories List of event categories for RDS instances list(string)
[
"availability",
"configuration change",
"failover",
"failure",
"low storage",
"maintenance"
]
no
db_instance_ids List of RDS instances to monitor list(string) [] no
name Name to apply for created resources string n/a yes
slack_webhook Slack webhook URL string n/a yes
tags n/a map(string) {} no

Outputs

Name Description
sns_topic_arn n/a

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published