resource "aws_cloudwatch_metric_alarm" "asg-CPUUtilization" { alarm_name = "${var.cw-alarm-prefix}:ASG:CPUUtilization:${var.asg-name}" comparison_operator = var.settings.CPUUtilization.comparison_operator evaluation_periods = var.settings.CPUUtilization.evaluation_periods metric_name = "CPUUtilization" period = var.settings.CPUUtilization.period statistic = var.settings.CPUUtilization.statistic threshold = var.settings.CPUUtilization.threshold alarm_description = "ASG:CPUUtilization" namespace = "AWS/EC2" insufficient_data_actions = [] actions_enabled = var.actions-enabled alarm_actions = [var.settings.CPUUtilization.action] ok_actions = [var.settings.CPUUtilization.action] dimensions = { AutoScalingGroupName = var.asg-name } tags = var.default-tags lifecycle { ignore_changes = [tags] } }