Setup integration: AWS RDS Event

You need to setup an AWS SNS HTTPS endpoint for this integration!

This integration requires marbot  plus

AWS RDS provides relational databases such as MySQL. RDS Events provide notifications when an RDS event occurs. An event can be the start of an automated backup, a Multi-AZ failover, or much more.

Monitoring Multi-AZ failovers

You need an existing RDS instance (Multi-AZ enabled) for this example to work!

You can run the RDS database instance in Multi-AZ mode. Multi-AZ will use two virtual machines to host your database. If the primary goes down, AWS will failover to the secondary. But this will take up to 5 minutes. You may want to know about this event because it will cause connection errors in your applications.

Before you can start to set up RDS Events, you have to make one change to the SNS topic endpoint that is required for this integration. You have to allow RDS Events to send messages to your topic.

Allowing AWS to send messages to your topic

  1. Visit https://console.aws.amazon.com/sns/?region=us-east-1
  2. Click on the Topics link on the left
  3. Select the topic that you created for marbot
  4. Click on the Actions button, where you click on the Edit topic policy link.
    Edit SNS topic policy
  5. Select the Advanced view tab

If this is the first time you edit the SNS topic policy, you should see a default entry like this:

{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"Statement": [
{
"Sid": "__default_statement_ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
[...TRUNCATED...]
}
]
}

You can replace the default policy with:

{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AWSRdsEvents",
"Effect": "Allow",
"Principal": {
"Service": "rds.amazonaws.com"
},
"Action": "sns:Publish",
"Resource": "ARN"
}
]
}

If the topic contains already a policy, you have to add an entry to the Statement array:

{
"Sid": "AWSRdsEvents",
"Effect": "Allow",
"Principal": {
"Service": "rds.amazonaws.com"
},
"Action": "sns:Publish",
"Resource": "ARN"
}
  1. Replace ARN with your SNS topic ARN that you created for marbot.
  2. Click on the Update policy button to save the policy.

Save SNS topic policy

Now, RDS is allowed to send messages to your topic. Continue to create an RDS Event Subscription.

Creating an RDS Event Subscription

  1. Visit https://console.aws.amazon.com/rds/home?region=us-east-1
  2. Click on the Event Subscriptions link on the left
  3. Click on the Create Event Subscription button
  4. Set a Name, e.g. marbot
  5. Set Send notifications to marbot or your other SNS topic name
  6. Set Source Type to Instances
  7. Set Event Categories to failover (you could select other events depending on your needs as well)
  8. The other fields can stay as they are
  9. Save by clicking the Create button.
    Creating an RDS Event Subscription

Sample Alert

You can simulate a failover by rebooting the RDS instance with the Reboot With Failover option enabled.
Simulate RDS failover
You should get an alert in Slack via a direct message:

Budget Alert