Skip to content

Instantly share code, notes, and snippets.

@quatrix
Created January 20, 2022 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quatrix/9d9984d3066fff3b713c2e464f05a6df to your computer and use it in GitHub Desktop.
Save quatrix/9d9984d3066fff3b713c2e464f05a6df to your computer and use it in GitHub Desktop.
resource "aws_cloudwatch_metric_alarm" "alarm" {
alarm_name = "dead_man_switch"
comparison_operator = "LessThanOrEqualToThreshold"
evaluation_periods = "1"
statistic = "Average"
metric_name = "Invocations"
namespace = "AWS/Lambda"
period = "60"
threshold = "0"
treat_missing_data = "breaching"
dimensions = {
FunctionName = aws_lambda_function.dead_man_switch.function_name
}
alarm_description = "Grafan is down"
alarm_actions = [aws_sns_topic.pagerduty_service.arn]
ok_actions = [aws_sns_topic.pagerduty_service.arn]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment