Skip to content

Commit

Permalink
Add a budget alert for when we use a lot of cloudwatch data scanning (#…
Browse files Browse the repository at this point in the history
…1704)

* Formatting
[review]

* type
  • Loading branch information
ben851 authored Dec 19, 2024
1 parent 23289cd commit 79bd4ff
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions aws/common/budget.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,38 @@ resource "aws_budgets_budget" "notify_global" {
}
}

resource "aws_budgets_budget" "cloudwatch_data_scanned" {
name = "cloudwatch-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
Expand Down

0 comments on commit 79bd4ff

Please sign in to comment.