terraform.aws-baseline-infra/modules/ManagementGovernance/Monitoring.EMR/main.tf

45 lines
1.7 KiB
HCL

resource "aws_cloudwatch_metric_alarm" "emr-AppsPending" {
alarm_name = "${var.cw-alarm-prefix}:EMR:AppsPending:${var.job-flow-id}"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = "1"
metric_name = "AppsPending"
period = "1800"
statistic = "Average"
threshold = var.threshold-AppsPending
alarm_description = "EMR:AppsPending"
namespace = "AWS/ElasticMapReduce"
insufficient_data_actions = []
actions_enabled = var.actions-enabled
alarm_actions = [var.sns-targets.alarm-actions-standard]
ok_actions = [var.sns-targets.alarm-actions-standard]
dimensions = {
JobFlowId = var.job-flow-id
}
tags = var.default-tags
lifecycle {
ignore_changes = [tags]
}
}
resource "aws_cloudwatch_metric_alarm" "emr-CapacityRemainingGB" {
alarm_name = "${var.cw-alarm-prefix}:EMR:CapacityRemainingGB:${var.job-flow-id}"
comparison_operator = "LessThanThreshold"
evaluation_periods = "1"
metric_name = "CapacityRemainingGB"
period = "3600"
statistic = "Average"
threshold = var.threshold-CapacityRemainingGB
alarm_description = "EMR:CapacityRemainingGB"
namespace = "AWS/ElasticMapReduce"
insufficient_data_actions = []
actions_enabled = var.actions-enabled
alarm_actions = [var.sns-targets.alarm-actions-urgent]
ok_actions = [var.sns-targets.alarm-actions-urgent]
dimensions = {
JobFlowId = var.job-flow-id
}
tags = var.default-tags
lifecycle {
ignore_changes = [tags]
}
}