diff --git a/main.tf b/main.tf index 88d4d69..ad28db7 100644 --- a/main.tf +++ b/main.tf @@ -62,7 +62,7 @@ resource "aws_ce_anomaly_monitor" "serviceanomaly" { resource "aws_ce_anomaly_subscription" "mainsubscription" { name = "RealtimeAnomalySubscription" - threshold = 250 + threshold = var.anomaly_threshold_in_usd frequency = "IMMEDIATE" monitor_arn_list = [ diff --git a/variables.tf b/variables.tf index 85b9fd5..9cf8f26 100644 --- a/variables.tf +++ b/variables.tf @@ -14,6 +14,11 @@ variable "account_budget_limit_in_usd" { default = "200.0" } +variable "anomaly_threshold_in_usd" { + description = "If there is an anomaly in cost above this limit, a message will be sent to SNS." + default = 250 +} + variable "env" { description = "A map of tags (key-value pairs) passed to resources." type = string