Skip to content

Instantly share code, notes, and snippets.

@downspot
Created February 11, 2018 19:08
Show Gist options
  • Save downspot/9516dee74cdb82b0268dce4411fbf074 to your computer and use it in GitHub Desktop.
Save downspot/9516dee74cdb82b0268dce4411fbf074 to your computer and use it in GitHub Desktop.
aws_cloudwatch_metric_alarm recover
resource "aws_cloudwatch_metric_alarm" "example_host_alarm" {
alarm_name = "${aws_instance.example_host_alarm.id}"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "StatusCheckFailed_System"
namespace = "AWS/EC2"
period = "60"
statistic = "Maximum"
threshold = "1.0"
alarm_description = "Created from EC2 Console"
alarm_actions = ["arn:aws:automate:us-east-1:ec2:recover"]
dimensions {
InstanceId = "${aws_instance.example_host_alarm.id}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment