Is there a way to restrict CloudWatch alarms to only trigger during specified time periods?

0

I have a Development account which only needs monitoring during business hours. Currently, notifications are being routed to OpsGenie via an SNS topic. There are options to silence the alerts at the OpsGenie level, but they are still generated, which skews alert metrics. Is there any way to prevent alerts from being sent to the topic outside of 9-5 business hours?

Thanks!

1개 답변
1

Hello, there is no built-in silence feature in CloudWatch alarms. It is however possible to prevent the alarm from sending notifications, using one of the following approaches:

  1. Disable the alarm actions during off-business hours using a lambda triggered by an eventbridge cron rule. Your alarm will still change state during off-business hours, but the notification will not be posted. You can call the lambda at 5pm to call https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DisableAlarmActions.html, and trigger the lambda at 9am to call https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_EnableAlarmActions.html

  2. Use metric math to silence the metric during off-business hours, for example create a metric math expression that would be equal to IF(HOUR(m1) > 9 AND HOUR(m1) < 17, m1) and alarm on that metric math expression. With that option, your alarm will never change state during off-business hours.

profile pictureAWS
Jsc
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠