AWS CloudWatch Alarm

Creating a CloudWatch Alarm to Automatically Trigger an SSM Runbook on MySQL Cluster Failures

To set up a CloudWatch Alarm for automatically triggering an SSM Runbook when your MySQL cluster experiences issues, follow these steps:

  1. Access the CloudWatch Service Dashboard.

    • Open the AWS dashboard and select CloudWatch from the list of services.
  2. Create a New Alarm:

    • In the CloudWatch dashboard’s left panel, select Alarms -> All alarms.
    • Click Create alarm.

Create VPC

  1. Select a Metric:
    • Click on select metric.
    • In the AWS namespaces, search and select NetworkELB.

Create VPC

  1. Choose Target Group Metric:
    • Under Metrics, select Target Group Metrics.

Create VPC

  1. Select Specific Metric:
    • Find and select the UnHealthyHostCount metric for the Network ELB in use.
    • Click Select metric.

Create VPC

  1. Set the Threshold:
    • Choose Static as the Threshold type.
    • Select Greater than….
    • Enter the value as 1.

Create VPC

  1. Configure Notifications:
    • In the Notification section, select Create new topic.
    • Name the topic mysql-failover-topic and enter an email for notifications.

Create VPC

  1. Select System Manager Action:
    • In System Manager action, choose create Incident.
    • Select the previously created response plan mysql-failover-plan.

Create VPC

  1. Complete the Setup:
    • Click Next, name the alarm mysql-cluster-failed-alert.
    • Click Next again, review the settings, and then click Create alarm.

Create VPC

Create VPC

By following the above steps, you can set up an alarm to automatically trigger a response for MySQL cluster issues.