I cannot modify the automatically created Cloudwatch alarms for TargetTrackingScaling policy type in AWS via terraform. I created a resource below.
resource "aws_autoscaling_policy" "my_autoscale_policy" {
name = "my-auto-scale-policy"
autoscaling_group_name = "${aws_autoscaling_group.my_autoscaling.name}"
policy_type = "TargetTrackingScaling"
target_tracking_configuration {
customized_metric_specification {
metric_dimension {
name = "QueueName"
value = "${aws_sqs_queue.my_sqs.name}"
}
metric_name = "ApproximateNumberOfMessagesVisible"
namespace = "AWS/SQS"
statistic = "Maximum"
}
target_value = "5"
}
}
This code works perfectly. It will automatically create 2 alarms (High and Low). However, I noticed that the alarms (specifically the “Low” alarms will be treated as “alarm” because it doesn’t have a data yet (missing data). How can I update “missing data treatment” and have it ‘none breaching’ via terraform?