From 042871298de75e635ad92a0247a393d5b9235793 Mon Sep 17 00:00:00 2001 From: Ben Larabie Date: Thu, 19 Dec 2024 13:51:04 -0500 Subject: [PATCH 1/2] Formatting [review] --- aws/common/budget.tf | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/aws/common/budget.tf b/aws/common/budget.tf index 9373c7a27..3e619dbdb 100644 --- a/aws/common/budget.tf +++ b/aws/common/budget.tf @@ -23,6 +23,38 @@ resource "aws_budgets_budget" "notify_global" { } } +resource "aws_budgets_budget" "cloudwatch_data_scanned" { + name = "coudwatch-data-scanned-budget" + budget_type = "USAGE" + limit_amount = "10000" + limit_unit = "GB" + time_unit = "DAILY" + + cost_filter { + name = "UsageType" + values = [ + "CAN1-DataScanned-Bytes", + ] + } + + notification { + comparison_operator = "GREATER_THAN" + threshold = 100 + threshold_type = "PERCENTAGE" + notification_type = "ACTUAL" + subscriber_sns_topic_arns = [aws_sns_topic.notification-canada-ca-alert-general.arn] + } + + notification { + comparison_operator = "GREATER_THAN" + threshold = 80 + threshold_type = "PERCENTAGE" + notification_type = "ACTUAL" + subscriber_sns_topic_arns = [aws_sns_topic.notification-canada-ca-alert-general.arn] + } + +} + module "budget_notifier" { source = "github.com/cds-snc/terraform-modules//spend_notifier?ref=v9.6.4" daily_spend_notifier_hook = var.budget_sre_bot_webhook From 772305195689e73693e7a793d2a6828a2bb839bc Mon Sep 17 00:00:00 2001 From: Ben Larabie Date: Thu, 19 Dec 2024 13:54:38 -0500 Subject: [PATCH 2/2] type --- aws/common/budget.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/common/budget.tf b/aws/common/budget.tf index 3e619dbdb..2befba153 100644 --- a/aws/common/budget.tf +++ b/aws/common/budget.tf @@ -24,7 +24,7 @@ resource "aws_budgets_budget" "notify_global" { } resource "aws_budgets_budget" "cloudwatch_data_scanned" { - name = "coudwatch-data-scanned-budget" + name = "cloudwatch-data-scanned-budget" budget_type = "USAGE" limit_amount = "10000" limit_unit = "GB"