Insufficient data on cloudwatch alarm created with terraform

Viewed 34

I have a cw alarm for monitoring the Autoscaling Instance Max Size, enabled GroupTotalInstances metric in Autoscaling group monitoring.

I have created this alarm using terraform, and manually with the same parameters, the one created with terraform give me Insufficient data, while the other one works great.

Compared them with the terraform output everything looks the same, I have other alarms created using terraform which are working great. Can't get the point what I'm doing wrong here.

  resource "aws_cloudwatch_metric_alarm" "asg_max_size" {
  alarm_name                = "test"
  alarm_description         = "test"
  alarm_actions             = ["${var.sns_cw_alarms_topic_arn}"]
  comparison_operator       = "GreaterThanOrEqualToThreshold"
  evaluation_periods        = 1
  datapoints_to_alarm       = 1
  metric_name               = "GroupTotalInstances"
  namespace                 = "AWS/Autoscaling"
  period                    = "${var.alarm_period}"
  statistic                 = "Maximum"
  threshold                 = "${var.instance_max_size}"
  treat_missing_data        = "missing"
  insufficient_data_actions = []
  ok_actions                = []

  dimensions = {
    "AutoScalingGroupName" = "${var.asg_name}"
  }

}
0 Answers
Related