Skip to content

Commit

Permalink
add new datapoints variable
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolnagpal committed Sep 1, 2021
1 parent 0f3568c commit f8df42c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ resource "aws_cloudwatch_metric_alarm" "default" {
evaluation_periods = var.evaluation_periods
metric_name = var.metric_name
namespace = var.namespace
datapoints_to_alarm = var.datapoints_to_alarm
period = var.period
statistic = var.statistic
threshold = var.threshold
Expand Down
14 changes: 10 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variable "environment" {
}

variable "label_order" {
type = list
type = list(any)
default = []
description = "Label order, e.g. `name`,`application`."
}
Expand Down Expand Up @@ -65,6 +65,12 @@ variable "evaluation_periods" {
description = "The number of periods over which data is compared to the specified threshold."
}

variable "datapoints_to_alarm" {
type = number
default = 2
description = "The number of datapoints that must be breaching to trigger the alarm."
}

variable "metric_name" {
type = string
default = "CPUUtilization"
Expand Down Expand Up @@ -102,7 +108,7 @@ variable "threshold_metric_id" {
}

variable "alarm_actions" {
type = list
type = list(any)
default = []
description = "The list of actions to execute when this alarm transitions into an ALARM state from any other state."
}
Expand All @@ -114,13 +120,13 @@ variable "actions_enabled" {
}

variable "insufficient_data_actions" {
type = list
type = list(any)
default = []
description = "The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state."
}

variable "ok_actions" {
type = list
type = list(any)
default = []
description = "The list of actions to execute when this alarm transitions into an OK state from any other state."
}
Expand Down

0 comments on commit f8df42c

Please sign in to comment.