Last active
March 1, 2019 17:38
-
-
Save 100daysofdevops/a87b78648ef30d83710136febd7fcfd7 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" "cpu-utilization" { | |
| alarm_name = "high-cpu-utilization-alarm" | |
| comparison_operator = "GreaterThanOrEqualToThreshold" | |
| evaluation_periods = "2" | |
| metric_name = "CPUUtilization" | |
| namespace = "AWS/EC2" | |
| period = "120" | |
| statistic = "Average" | |
| threshold = "80" | |
| alarm_description = "This metric monitors ec2 cpu utilization" | |
| 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