forked from 2i2c-org/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
terraform, aws: add last-3-months-mean budget with alert by default
- Loading branch information
1 parent
7a8be26
commit c7f25fa
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
resource "aws_budgets_budget" "budgets" { | ||
count = var.default_budget_alert.enabled ? 1 : 0 | ||
|
||
name = "Auto-adjusting budget for ${var.cluster_name}" | ||
budget_type = "COST" | ||
limit_unit = "USD" | ||
time_unit = "MONTHLY" | ||
|
||
auto_adjust_data { | ||
auto_adjust_type = "HISTORICAL" | ||
|
||
historical_options { | ||
budget_adjustment_period = 3 | ||
} | ||
} | ||
|
||
notification { | ||
comparison_operator = "GREATER_THAN" | ||
threshold = 120 | ||
threshold_type = "PERCENTAGE" | ||
notification_type = "FORECASTED" | ||
subscriber_email_addresses = [ | ||
for email in var.default_budget_alert.subscriber_email_addresses : | ||
replace(email, "{var_cluster_name}", var.cluster_name) | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters