mbt
mbt

Reputation: 39

How can i notify lambda result on cloudwatch alarm?

How can i notify a result of lambda when status OK(normal) and NG both?

I set a alarm on cloudwatch when status NG. It was working. But when i got OK(normal) status, i couldn't get notify email. I set up custom metrics by lamda result log when OK(normal) status on cloudwatch alarm.

Is it possible on alarm? Is there an any simple way?

Upvotes: 0

Views: 1612

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269340

It sounds like your requirements are:

  • Trigger an AWS Lambda function when a CloudWatch alarm enters the ALARM state
  • Trigger an AWS Lambda function when a CloudWatch alarm enters the OK state

Each AWS CloudWatch alarm can be configured with multiple Actions.

Therefore, you can create one Action for ALARM and another action for OK:

CloudWatch Alarm notification

The CloudWatch Alarm can send a notification to an Amazon SNS topic. The AWS Lambda function can subscribe to the SNS topic and will be triggered when the alarm sends the notification to SNS.

Upvotes: 3

Related Questions