-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudwatch.tf
40 lines (36 loc) · 1.2 KB
/
cloudwatch.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module "metric_alarm" {
source = "terraform-aws-modules/cloudwatch/aws//modules/metric-alarms-by-multiple-dimensions"
version = "5.3.1"
alarm_name = "${module.label.id}-"
alarm_description = "Errors found"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = 1
threshold = 1
period = 60
unit = "Count"
treat_missing_data = "ignore"
namespace = "AWS/Lambda"
metric_name = "Errors"
statistic = "Sum"
dimensions = {
"authors" = {
FunctionName = "${module.lambdas.lambda_authors_lambda_function_name}"
},
"courses" = {
FunctionName = "${module.lambdas.lambda_courses_lambda_function_name}"
},
"get-course" = {
FunctionName = "${module.lambdas.lambda_get_course_lambda_function_name}"
},
"save-course" = {
FunctionName = "${module.lambdas.lambda_save_course_lambda_function_name}"
},
"update-course" = {
FunctionName = "${module.lambdas.lambda_update_course_lambda_function_name}"
},
"delete-course" = {
FunctionName = "${module.lambdas.lambda_delete_course_lambda_function_name}"
}
}
alarm_actions = [module.notify_slack.slack_topic_arn]
}