Last active
March 1, 2019 17:37
-
-
Save 100daysofdevops/886998687b910e54eeac65915cdf2d77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_cloudwatch_metric_alarm" "instance-health-check" { | |
| alarm_name = "instance-health-check" | |
| comparison_operator = "GreaterThanOrEqualToThreshold" | |
| evaluation_periods = "1" | |
| metric_name = "StatusCheckFailed" | |
| namespace = "AWS/EC2" | |
| period = "120" | |
| statistic = "Average" | |
| threshold = "1" | |
| alarm_description = "This metric monitors ec2 health status" | |
| alarm_actions = [ "${aws_sns_topic.alarm.arn}" ] | |
| dimensions { | |
| InstanceId = "${aws_instance.my_instance.*.id[count.index}" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment