-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables_governance.tf
34 lines (33 loc) · 1.64 KB
/
variables_governance.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (c) 2024 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
# ------------------------------------------------------
# ----- Cost Management - Budget
# ------------------------------------------------------
variable "budget_alert_threshold" {
type = number
default = 100
description = "The threshold for triggering the alert expressed as a percentage. 100% is the default."
validation {
condition = var.budget_alert_threshold > 0 && var.budget_alert_threshold < 10000
error_message = "Validation failed for budget_alert_threshold: The threshold percentage should be greater than 0 and less than or equal to 10,000, with no leading zeros and a maximum of 2 decimal places."
}
}
variable "budget_amount" {
type = number
default = 1000
description = "The amount of the budget expressed as a whole number in the currency of the customer's rate card"
}
variable "create_budget" {
type = bool
default = false
description = "Whether a budget is deployed."
}
variable "budget_alert_email_endpoints" {
type = list(string)
default = []
description = "List of email addresses for all cost related notifications."
validation {
condition = length([for e in var.budget_alert_email_endpoints : e if length(regexall("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$", e)) > 0]) == length(var.budget_alert_email_endpoints)
error_message = "Validation failed budget_alert_email_endpoints: invalid email address."
}
}