Skip to content

Instantly share code, notes, and snippets.

@nhammad
Created August 15, 2022 17:09
Show Gist options
  • Save nhammad/7e17d2a691c53d1ec3b21cf80c0797bd to your computer and use it in GitHub Desktop.
Save nhammad/7e17d2a691c53d1ec3b21cf80c0797bd to your computer and use it in GitHub Desktop.
resource "aws_cloudwatch_metric_alarm" "alarm" {
alarm_name = local.alarm_name
metric_name = var.metric_name
namespace = var.namespace
period = var.period
evaluation_periods = var.evaluation_periods
comparison_operator = var.comparison_operator
statistic = var.statistic
threshold = var.threshold
actions_enabled = true
alarm_actions = [aws_sns_topic.turn-off-topic.arn]
treat_missing_data = "notBreaching"
dimensions = {
instanceId = var.instance_id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment