|
1 | | - |
2 | | -variable "location" { |
3 | | - type = string |
4 | | - default = "westeurope" |
5 | | -} |
6 | | - |
7 | 1 | variable "budget_name" { |
8 | | - type = string |
9 | | - default = "budget_alert" |
| 2 | + type = string |
| 3 | + description = "Name of the budget alert rule" |
| 4 | + default = "budget_alert" |
10 | 5 | } |
11 | 6 |
|
12 | 7 | variable "subscription_id" { |
13 | 8 | type = string |
14 | 9 | description = "The ID of the subscription at which you want to assign the budget" |
15 | 10 | } |
16 | 11 |
|
17 | | -variable "resource_group_for_action_group_name" { |
18 | | - type = string |
19 | | - description = "The name of the resource group to deploy the action group inside" |
20 | | - default = "rg_action_group" |
| 12 | +variable "contact_emails" { |
| 13 | + type = list(string) |
| 14 | + description = "List of emails of the users who should receive the Budget alert. e.g. ['foo@example.com', 'bar@example.com']" |
21 | 15 | } |
22 | 16 |
|
23 | | -variable "end_date" { |
24 | | - type = string |
25 | | - description = "End date of the budget rule, Timestamp in the format YYYY-MM-DDTHH:MM:SSZ" |
26 | | - validation { |
27 | | - condition = can(regex("^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T\\d{2}:\\d{2}:\\d{2}Z$", var.end_date)) |
28 | | - error_message = "Timestamp must be in the format YYYY-MM-DDTHH:MM:SSZ" |
29 | | - } |
| 17 | +variable "monthly_budget_amount" { |
| 18 | + type = number |
| 19 | + description = "Set the monthly budget goal for this subscription" |
| 20 | + default = 100 |
30 | 21 | } |
31 | 22 |
|
32 | | -variable "start_date" { |
| 23 | +variable "actual_threshold" { |
33 | 24 | type = string |
34 | | - description = "Start date of the budget rule, should be first day of the month" |
35 | | - validation { |
36 | | - condition = can(regex("^\\d{4}-(0[1-9]|1[0-2])-(01)T\\d{2}:\\d{2}:\\d{2}Z$", var.start_date)) |
37 | | - error_message = "The 'start_date' must be in the format 'YYYY-MM-01THH:MM:SSZ', e.g., '2023-11-01T00:00:00Z'." |
38 | | - } |
| 25 | + description = "The precise percentage of the monthly budget at which you wish to activate the alert upon reaching. E.g. '15' for 15% or '120' for 120%" |
39 | 26 | } |
40 | 27 |
|
41 | | -variable "contact_emails" { |
42 | | - type = list(string) |
43 | | - description = "List of emails of the users who should receive the Budget alert. e.g. ['foo@example.com', 'bar@example.com']" |
| 28 | +variable "forcasted_threshold" { |
| 29 | + type = string |
| 30 | + description = "The forcasted percentage of the monthly budget at which you wish to activate the alert upon reaching. E.g. '15' for 15% or '120' for 120%" |
44 | 31 | } |
45 | 32 |
|
| 33 | + |
| 34 | +// Uncomment next 2 variables if you want to change the start and end date via inputs -------------------------------- |
| 35 | +# variable "end_date" { |
| 36 | +# type = string |
| 37 | +# description = "End date of the budget rule, Timestamp in the format YYYY-MM-DDTHH:MM:SSZ" |
| 38 | +# validation { |
| 39 | +# condition = can(regex("^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T\\d{2}:\\d{2}:\\d{2}Z$", var.end_date)) |
| 40 | +# error_message = "Timestamp must be in the format YYYY-MM-DDTHH:MM:SSZ" |
| 41 | +# } |
| 42 | +# } |
| 43 | + |
| 44 | +# variable "start_date" { |
| 45 | +# type = string |
| 46 | +# description = "Start date of the budget rule, should be first day of the month. Timestamp in the format YYYY-MM-DDTHH:MM:SSZ" |
| 47 | +# validation { |
| 48 | +# condition = can(regex("^\\d{4}-(0[1-9]|1[0-2])-(01)T\\d{2}:\\d{2}:\\d{2}Z$", var.start_date)) |
| 49 | +# error_message = "The 'start_date' must be in the format 'YYYY-MM-01THH:MM:SSZ', e.g., '2023-11-01T00:00:00Z'." |
| 50 | +# } |
| 51 | +# } |
| 52 | +//------------------------------------------------------------------------------------------------------------------------ |
0 commit comments