Skip to content

Commit cabb3ab

Browse files
Create cloudwatch_status_check_via_terraform
1 parent 5aac5f3 commit cabb3ab

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: cloudwatch_status_check_via_terraform

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
resource "aws_cloudwatch_metric_alarm" "instance-health-check" {
2+
alarm_name = "instance-health-check"
3+
comparison_operator = "GreaterThanOrEqualToThreshold"
4+
evaluation_periods = "1"
5+
metric_name = "StatusCheckFailed"
6+
namespace = "AWS/EC2"
7+
period = "120"
8+
statistic = "Average"
9+
threshold = "1"
10+
alarm_description = "This metric monitors ec2 health status"
11+
alarm_actions = [ "${aws_sns_topic.alarm.arn}" ]
12+
13+
dimensions {
14+
InstanceId = "${aws_instance.my_instance.id}"
15+
}
16+
}

0 commit comments

Comments
 (0)