0

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?

1 Answer 1

3

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.

7
  • Thank you for a reply. I think the above settings are couldn't notify state from OK to OK. So, i just want to notify when even normal( OK → OK). Is there any way?
    – mbt
    Commented Jul 11, 2018 at 2:35
  • 1
    A notification can only be generated when an alarm changes state. There is no facility for sending out continuous notifications of the same status. Commented Jul 11, 2018 at 2:40
  • I see. How to monitor a lambda batch is working fine everyday? Is there any other service on aws?
    – mbt
    Commented Jul 11, 2018 at 2:46
  • What do you mean by "monitor a lambda batch is working fine everyday"? Commented Jul 11, 2018 at 3:02
  • It means regardless of lambda(OK, ALARM) result, i wanted to know result. But it seems impossible only on cloudwatch alarm.
    – mbt
    Commented Jul 11, 2018 at 4:27

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