I am using Python Boto to launch new server in AWS VPC, I have SNS topic setup and I plan to get notified when my new server's System reachability check and Instance reachability check fails. For achieving this I am getting list of metrics(this is all a part of creating a new alarm as a part of server provision script):
cw_conn.list_metrics(dimensions={'InstanceId':instance_id}, metric_name=StatusCheckFailed)[0]
Problem is that when a instance starts all the metrics are not available immediately and I get IndexError: 'list index out of range'
error.
I would really appreciate if anyone who has a solution to this problem can guide me or share a work around this issue.
Thanks