diff --git a/main.tf b/main.tf index a26cc60..5f09338 100644 --- a/main.tf +++ b/main.tf @@ -50,4 +50,12 @@ resource "aws_ce_anomaly_subscription" "mainsubscription" { type = "EMAIL" address = "aws-budget-alarms-email.obdw3nwx@vyutv.pagerduty.com" } + + dynamic "subscriber" { + for_each = var.notification_emails + content { + type = "EMAIL" + address = subscriber.value + } + } } diff --git a/variables.tf b/variables.tf index 0964401..e547290 100644 --- a/variables.tf +++ b/variables.tf @@ -17,3 +17,9 @@ variable "anomaly_threshold_percentage" { description = "Anomaly in cost above this percentage." default = "100" } + +variable "notification_emails" { + description = "Emails to notify when the alarm is triggered." + type = list(string) + default = [] +} \ No newline at end of file