2023-01-05 23:35:31 +08:00
|
|
|
resource "aws_cloudwatch_metric_alarm" "emr-alarms" {
|
|
|
|
for_each = var.settings
|
2023-05-23 13:10:16 +08:00
|
|
|
alarm_name = "${each.value["ecccode"]}-EMR_${var.job-flow-id}-${each.value["metric"]}"
|
2023-01-05 23:35:31 +08:00
|
|
|
comparison_operator = each.value["comparison_operator"]
|
|
|
|
evaluation_periods = each.value["evaluation_periods"]
|
|
|
|
metric_name = each.value["metric"]
|
|
|
|
period = each.value["period"]
|
|
|
|
statistic = each.value["statistic"]
|
|
|
|
threshold = each.value["threshold"]
|
|
|
|
alarm_description = "EMR:${each.value["metric"]}"
|
2022-10-25 14:21:37 +08:00
|
|
|
namespace = "AWS/ElasticMapReduce"
|
|
|
|
insufficient_data_actions = []
|
2022-10-26 11:13:56 +08:00
|
|
|
actions_enabled = var.actions-enabled
|
2023-01-05 23:35:31 +08:00
|
|
|
alarm_actions = [each.value["action"]]
|
|
|
|
ok_actions = [each.value["action"]]
|
2022-10-25 14:21:37 +08:00
|
|
|
dimensions = {
|
|
|
|
JobFlowId = var.job-flow-id
|
|
|
|
}
|
2023-05-23 13:10:16 +08:00
|
|
|
}
|