Skip to content

Commit

Permalink
Added treat missing data support (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
emir-demirovic authored Jun 10, 2024
1 parent 702e2f9 commit 0b3f8fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ usage: |-
actions_enabled = true
insufficient_data_actions = []
ok_actions = []
treat_missing_data = "ignore"
dimensions = {
instance_id = module.ec2.instance_id[0]
}
Expand Down
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ resource "aws_cloudwatch_metric_alarm" "default" {
actions_enabled = var.actions_enabled
insufficient_data_actions = var.insufficient_data_actions
ok_actions = var.ok_actions
treat_missing_data = var.treat_missing_data
tags = module.labels.tags

dimensions = var.dimensions
Expand All @@ -52,6 +53,7 @@ resource "aws_cloudwatch_metric_alarm" "expression" {
actions_enabled = var.actions_enabled
insufficient_data_actions = var.insufficient_data_actions
ok_actions = var.ok_actions
treat_missing_data = var.treat_missing_data
tags = module.labels.tags
dynamic "metric_query" {
for_each = var.query_expressions
Expand Down Expand Up @@ -97,6 +99,7 @@ resource "aws_cloudwatch_metric_alarm" "anomaly" {
actions_enabled = var.actions_enabled
insufficient_data_actions = var.insufficient_data_actions
ok_actions = var.ok_actions
treat_missing_data = var.treat_missing_data
tags = module.labels.tags
dynamic "metric_query" {
for_each = var.query_expressions
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ variable "insufficient_data_actions" {
description = "The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state."
}

variable "treat_missing_data" {
type = string
default = "missing"
description = "Sets how an alarm is going to handle missing data points."
}

variable "ok_actions" {
type = list(any)
default = []
Expand Down

0 comments on commit 0b3f8fa

Please sign in to comment.