Created
September 12, 2020 18:57
-
-
Save DanielDaCosta/b4f9eac62c8ffeee109876864b6e641a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_cloudwatch_metric_alarm" "lambda_alarm" { | |
| for_each = length(keys(local.alarms_dimensions)) > 0 ? local.alarms_dimensions : {} | |
| alarm_name = "${each.key}-alarm" | |
| comparison_operator = "GreaterThanThreshold" | |
| evaluation_periods = 1 | |
| metric_name = "Errors" | |
| namespace = "AWS/Lambda" | |
| period = "60" | |
| statistic = "Sum" | |
| threshold = 0 | |
| datapoints_to_alarm = 1 | |
| alarm_actions = [aws_sns_topic.sns_alarms.arn] | |
| alarm_description = "Triggerd by errors in lambdas" | |
| treat_missing_data = "notBreaching" | |
| dimensions = each.value | |
| tags = { | |
| Product = local.name_dash | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment