Cloudwatch Alerts sends notifications via SNS to your topics when an alarm state changed. For example, you can listen to all the OK and ALARM statuses and implement your own logic to send Slack notifications to your organization.
$message is the array message of the content, while $originalMessage is the entire SNS message as an array.
useRenokiCo\AwsWebhooks\Http\Controllers\CloudwatchWebhook;classMyCloudwatchControllerextendsCloudwatchWebhook{/** * Handle the event when an alarm transitioned to OK. * * @paramarray $message * @paramarray $originalMessage * @param\Illuminate\Http\Request $request * @returnvoid */protectedfunctiononOkState(array $message,array $originalMessage,Request $request) {// }/** * Handle the event when an alarm transitioned to ALARM. * * @paramarray $message * @paramarray $originalMessage * @param\Illuminate\Http\Request $request * @returnvoid */protectedfunctiononAlarmState(array $message,array $originalMessage,Request $request) {// }/** * Handle the event when an alarm transitioned to INSUFFICIENT_DATA. * * @paramarray $message * @paramarray $originalMessage * @param\Illuminate\Http\Request $request * @returnvoid */protectedfunctiononInsufficientDataState(array $message,array $originalMessage,Request $request) {// }}