amazon web services - StatusCheckFailed Cloud Watch Alarm for Auto Scaling Group remains in INSUFFICIENT_DATA after being created with terraform -


i trying add cloud watch alarm existing auto scaling group. after running terraform apply, can see alarm listed under cloudwatch section of aws console. however, alarm's state stay in insufficient_data.

state details contains message state changed insufficient_data @ 2016/04/19. reason: unchecked: initial alarm creation

the terraform resource i've used create alarm below:

resource "aws_cloudwatch_metric_alarm" "dwalters_status_check_failed" {     alarm_name = "dwaltersstatuscheckfailedtest"     alarm_description = "test if alarm goes insufficient_date -> ok after being initialized"     comparison_operator = "greaterthanorequaltothreshold"     dimensions = {       autoscalinggroupname = "test-autoscaling-group"     }     evaluation_periods = "1"     metric_name = "statuscheckfailed"     namespace = "aws/ec2"     period = "300"     statistic = "maximum"     threshold = "1"     unit = "count"     alarm_actions = [] } 

even though metric , auto scaling group listed in alarm exist, have select alarm, click modify, reselect same metric , auto scaling group, , click 'save' in order change state insufficient_data ok.

has faced similar issue?

with experience, dimensions part problem.

suppose did in terraform, autoscalinggroupname shouldn't hard coded.

dimensions = {   autoscalinggroupname = "test-autoscaling-group" } 

could change

dimensions = {   autoscalinggroupname = "${aws_autoscaling_group.bar.name}" } 

you need adjust resource name, depend on how define scaling group.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -