<p>It is possible to trigger Lambda function from CloudWatch alarm, by using EventBridge <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-and-eventbridge.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-and-eventbridge.html</a></p>

CC BY-SA 4.0
2022-09-23T03:44:27.493Z
2022-09-23T03:44:27.493Z
Anggra S
<p>As far as I know, it is not possible. The the offcial A<a href="http://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html" rel="noreferrer">WS Lambda documentation</a> says it support CloudWatch <strong>Events</strong>, but no mention of CloudWatch <strong>Alarms</strong> (and <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html" rel="noreferrer">CW Events</a> != <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html" rel="noreferrer">CW Alarms</a>)</p>

<p>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.</p>

CC BY-SA 3.0
2017-03-02T19:52:09.597Z
2017-03-02T20:09:35.813Z
2017-03-02T20:09:35.813Z
Alexandre
<p>Currently, for triggering a lambda function in response to a CloudWatch alarm, I need to route the alarm via SNS, like this:</p>

<pre><code>AWS CloudWatch Alarm --&gt; Send to a topic in SNS --&gt; SNS topic triggers the lambda function
</code></pre>

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

<p>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:</p>

<blockquote>
  <p><a href="https://i.sstatic.net/YuC5Z.png" rel="noreferrer"><img src="https://i.sstatic.net/YuC5Z.png" alt="enter image description here"></a></p>
</blockquote>

CC BY-SA 3.0
2017-03-02T20:00:00.683Z
Possible duplicate of http://stackoverflow.com/questions/34800976/how-to-connect-a-cloudwatch-alarm-to-a-lambda-function
Alexandre
CC BY-SA 4.0
2024-01-18T07:59:23.657Z
It is possible to trigger Lambda function from CloudWatch alarm
https://aws.amazon.com/about-aws/whats-new/2023/12/amazon-cloudwatch-alarms-lambda-change-action/
Tomas.R
<aws-lambda><amazon-cloudwatch><amazon-sqs>
Is it possible to trigger an AWS Lambda function directly from CloudWatch alarm?
Dawny33
# Is it possible to trigger an AWS Lambda function directly from CloudWatch alarm?

(Asked by: username_0 on 2017-03-02)

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:

**Tags:** aws-lambda, amazon-cloudwatch, amazon-sqs

> **Comments:**
> **username_1**: Possible duplicate of http://stackoverflow.com/questions/34800976/how-to-connect-a-cloudwatch-alarm-to-a-lambda-function  
> **username_2**: It is possible to trigger Lambda function from CloudWatch alarm https://aws.amazon.com/about-aws/whats-new/2023/12/amazon-cloudwatch-alarms-lambda-change-action/  

---

## 2 answers

### Answer by username_1 on 2017-03-02. Score: 10 | Accepted answer

As far as I know, it is not possible. The the offcial A[WS Lambda documentation](http://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html) says it support CloudWatch **Events**, but no mention of CloudWatch **Alarms** (and [CW Events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html) != [CW Alarms](http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html))

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.


---

### Answer by username_3 on 2022-09-23. Score: 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>


---

