-
Notifications
You must be signed in to change notification settings - Fork 252
/
variables.tf
165 lines (136 loc) · 5.25 KB
/
variables.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
variable "name" {
description = "Name of the azure file storage instance"
default = "backup"
}
variable "create_resource_group" {
description = "Whether to create resource group and use it for all resources"
default = true
}
variable "resource_group_name" {
description = "A container that holds related resources for an Azure solution"
default = ""
}
variable "location" {
description = "The location/region to keep all your network resources. To get the list of all locations with table format from azure cli, run 'az account list-locations -o table'"
default = "eastus2"
}
variable "resource_prefix" {
description = "(Optional) Prefix to use for all resoruces created (Defaults to resource_group_name)"
default = ""
}
variable "create_storage_account" {
description = "Whether to create storage account and use it for all backups"
default = true
}
variable "storage_account_resource_group_name" {
description = "A container that holds related resources for an Azure solution"
default = ""
}
variable "storage_account_name" {
description = "(Optional) Indicates the name of the storage account to either use or create"
default = ""
}
variable "storage_account_tier" {
description = "(Optional) Indicates the storage acccount tier"
default = ""
}
variable "storage_account_replication_type" {
description = "(Optional) Indicates the storage account replication type"
default = "LZR"
}
variable "recovery_services_vault_name" {
description = "(Optional) Indicates the name of recovery services vault to be created"
default = ""
}
variable "recovery_services_vault_sku" {
description = "(Optional) Indicates the sku for the recovery services value to use during creation"
default = "Standard"
}
variable "recovery_services_vault_storage_mode" {
description = "(Optional) Indicates the mode for the recovery storage vault"
default = "LocallyRedundant"
validation {
condition = contains(["LocallyRedundant"], var.recovery_services_vault_storage_mode)
error_message = "The value must be set to one of the following: LocallyRedundant"
}
}
variable "backup_policy_type" {
description = "(Optional) Indicates which version type to use when creating the backup policy"
default = "V2"
validation {
condition = contains(["V1","V2"], var.backup_policy_type)
error_message = "The value must be set to one of the following: V1, V2"
}
}
variable "backup_policy_time_zone" {
description = "(Optional) Indicates the timezone that the policy will use"
default = "UTC"
}
variable "backup_policy_frequency" {
description = "(Optional) Indicate the fequency to use for the backup policy"
default = "Daily"
validation {
condition = contains(["Daily"], var.backup_policy_frequency)
error_message = "The value must be set to one of the following: Daily"
}
}
variable "backup_policy_time" {
description = "(Optional) Indicates the time for when to execute the backup policy"
default = "23:00"
}
variable "backup_policy_retention_daily_count" {
description = "(Optional) Indicates the number of daily backups to retain (set to blank to disable)"
type = number
default = 7
}
variable "backup_polcy_retention_weekly_count" {
description = "(Optional) Indicates the number of weekly backups to retain (set to blank to disable)"
type = number
default = 4
}
variable "backup_policy_retention_weekly_weekdays" {
description = "(Optional) Indicates which days of the week the weekly backup will be taken"
type = set(string)
default = [ "Saturday" ]
validation {
condition = can([for s in var.backup_policy_retention_weekly_weekdays : contains([ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ], s)])
error_message = "The value must contain one of the following: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday"
}
}
variable "backup_polcy_retention_monthly_count" {
description = "(Optional) Indicates the number of monthly backups to retain (set to blank to disable)"
type = number
default = 6
}
variable "backup_policy_retention_monthly_weekdays" {
description = "(Optional) Indicates which days of the week the monthly backup will be taken"
type = set(string)
default = [ "Saturday" ]
validation {
condition = can([for s in var.backup_policy_retention_monthly_weekdays : contains([ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ], s)])
error_message = "The value must contain one of the following: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday"
}
}
variable "backup_virtual_machines" {
description = "Contains the list virtual machines that will be backed up"
type = list(object({
name = string
resource_group_name = string
os_type = string
}))
default = []
}
variable "backup_file_shares" {
description = "Contains the list file shares that will be backed up"
type = list(object({
name = string
storage_account_name = string
resource_group_name = string
}))
default = []
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}