Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a budget alert for when we use a lot of cloudwatch data scanning #1704

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = "coudwatch-data-scanned-budget"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the budget name. It should be cloudwatch-data-scanned-budget instead of coudwatch-data-scanned-budget.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

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
Loading