13

Currently, for triggering a lambda function in response to a CloudWatch alarm, I need to route the alarm via SNS, like this:

AWS CloudWatch Alarm --> Send to a topic in SNS --> SNS topic triggers the lambda function

So, is there a way I can do it directly, without SNS in the middle? [Reason: Less touch points and a bit of cost optimization].

CloudWatch events trigger lambda but there is no way I can trigger alarms via it. The only options available in CloudWatch events for SQS are:

enter image description here

1

2 Answers 2

10

As far as I know, it is not possible. The the offcial AWS Lambda documentation says it support CloudWatch Events, but no mention of CloudWatch Alarms (and CW Events != CW Alarms)

What you are currently doing, sending the alarms on a SNS and using listening on a topic seems the way to go. In fact, CloudWatch Alarms only outputs to SNS so far.

1

It is possible to trigger Lambda function from CloudWatch alarm, by using EventBridge https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-and-eventbridge.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.