0

I have a Route 53 health check configured that is used to move a web site in and out of "maintenance mode" in the event that the checks fail. Works all very lovely and automated.

The Route 53 health checks have the option to configure alarms and send notifications to an SNS topic. Also very lovely. HOWEVER, I have no control over the actual message sent and, frankly, it is pretty ugly/technical.

I'd like to be able to "transform" the message, as we can do with CloudWatch Events, to make it a bit more useful for the intended audience of C levels and managers. So, that would mean I need to build a CloudWatch event (I'm guessing). And there lies my struggle.

The only option for Route 53 and CloudWatch Events is "AWS API Call via CloudTrail" and that's where I lose the trail. Not sure if this is possible. Anyone done it?

Or better ideas? I suppose someone will say, "Oh just write a Lambda" and trigger it from SNS to send the emails. I haven't written code in 15 years... I'm not sure that's my best option ;-) I can write a little PowerShell though if that helps.

Chris_K
  • 3,434
  • 6
  • 41
  • 45

1 Answers1

0

OK, this wasn't as difficult as I was thinking. Just had to "think around the corner" a bit.

First I disabled "send notification" off of the Route 53 Health Check alarm. In CloudWatch events, I created a rule to monitor the alarm state of the health checker -- and from there I could do my input transformation on the message going to SNS (and ultimately an email distro group).

{
  "source": [
    "aws.cloudwatch"
  ],
  "detail-type": [
    "CloudWatch Alarm State Change"
  ],
  "detail": {
    "alarmName": [
      "THE-ALARM-NAME-FOR-THE-ROUTE53-HEALTHCHECK"
    ]
  }
}
Chris_K
  • 3,434
  • 6
  • 41
  • 45