ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
1 changed files with 145336 additions and 0 deletions
27
terraform/external/short/budget.tf
vendored
Normal file
27
terraform/external/short/budget.tf
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
resource "oci_budget_budget" "short" {
|
||||
provider = oci.home
|
||||
amount = 1
|
||||
compartment_id = local.tenancy
|
||||
description = "Tier S is expected to incur no monthly charges"
|
||||
display_name = "short"
|
||||
reset_period = "MONTHLY"
|
||||
target_type = "COMPARTMENT"
|
||||
targets = [oci_identity_compartment.ingress.id]
|
||||
}
|
||||
|
||||
resource "oci_budget_alert_rule" "short" {
|
||||
provider = oci.home
|
||||
for_each = {
|
||||
actual = { type = "ACTUAL", threshold = 1 }
|
||||
forecast = { type = "FORECAST", threshold = 100 }
|
||||
}
|
||||
|
||||
budget_id = oci_budget_budget.short.id
|
||||
display_name = each.key
|
||||
description = "${each.value.type} Tier S spend reaches ${each.value.threshold}% of budget"
|
||||
message = "Tier S is expected to cost zero. Review charges in the short compartment."
|
||||
recipients = data.vault_generic_secret.config.data["budget_alert_recipients"]
|
||||
threshold = each.value.threshold
|
||||
threshold_type = "PERCENTAGE"
|
||||
type = each.value.type
|
||||
}
|
||||
Loading…
Reference in a new issue