-
Notifications
You must be signed in to change notification settings - Fork 78
/
variables.budget.tf
79 lines (73 loc) · 2.74 KB
/
variables.budget.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
variable "budget_enabled" {
type = bool
description = <<DESCRIPTION
Whether to create budgets.
If enabled, supply the list of budgets in `var.budgets`.
DESCRIPTION
default = false
}
variable "budgets" {
type = map(object({
amount = number
time_grain = string
time_period_start = string
time_period_end = string
relative_scope = optional(string, "")
notifications = optional(map(object({
enabled = bool
operator = string
threshold = number
threshold_type = optional(string, "Actual")
contact_emails = optional(list(string), [])
contact_roles = optional(list(string), [])
contact_groups = optional(list(string), [])
locale = optional(string, "en-us")
})), {})
}))
default = {}
description = <<DESCRIPTION
Map of budgets to create for the subscription.
- `amount` - The total amount of cost to track with the budget.
- `time_grain` - The time grain for the budget. Must be one of Annually, BillingAnnual, BillingMonth, BillingQuarter, Monthly, or Quarterly.
- `time_period_start` - The start date for the budget.
- `time_period_end` - The end date for the budget.
- `relative_scope` - (optional) Scope relative to the created subscription. Omit, or leave blank for subscription scope.
- `notifications` - (optional) The notifications to create for the budget.
- `enabled` - Whether the notification is enabled.
- `operator` - The operator for the notification. Must be one of GreaterThan or GreaterThanOrEqualTo.
- `threshold` - The threshold for the notification. Must be between 0 and 1000.
- `threshold_type` - The threshold type for the notification. Must be one of Actual or Forecasted.
- `contact_emails` - The contact emails for the notification.
- `contact_roles` - The contact roles for the notification.
- `contact_groups` - The contact groups for the notification.
- `locale` - The locale for the notification. Must be in the format xx-xx.
time_period_start and time_period_end must be UTC in RFC3339 format, e.g. 2018-05-13T07:44:12Z.
Example value:
```terraform
subscription_budgets = {
budget1 = {
amount = 150
time_grain = "Monthly"
time_period_start = "2024-01-01T00:00:00Z"
time_period_end = "2027-12-31T23:59:59Z"
notifications = {
eightypercent = {
enabled = true
operator = "GreaterThan"
threshold = 80
threshold_type = "Actual"
contact_emails = ["[email protected]"]
}
budgetexceeded = {
enabled = true
operator = "GreaterThan"
threshold = 120
threshold_type = "Forecasted"
contact_roles = ["Owner"]
}
}
}
}
```
DESCRIPTION
}