23 lines
845 B
HCL
23 lines
845 B
HCL
resource "aws_cloudwatch_metric_alarm" "asg-CPUUtilization" {
|
|
alarm_name = "${var.cw-alarm-prefix}:ASG:CPUUtilization:${var.asg-name}"
|
|
comparison_operator = "GreaterThanThreshold"
|
|
evaluation_periods = "3"
|
|
metric_name = "CPUUtilization"
|
|
period = "1800"
|
|
statistic = "Average"
|
|
threshold = var.threshold-CPUUtilization
|
|
alarm_description = "ASG:CPUUtilization"
|
|
namespace = "AWS/EC2"
|
|
insufficient_data_actions = []
|
|
actions_enabled = var.actions-enabled
|
|
alarm_actions = [var.alarm-actions-urgent]
|
|
ok_actions = [var.alarm-actions-urgent]
|
|
dimensions = {
|
|
AutoScalingGroupName = var.asg-name
|
|
}
|
|
tags = var.default-tags
|
|
lifecycle {
|
|
ignore_changes = [tags]
|
|
}
|
|
}
|