-
Notifications
You must be signed in to change notification settings - Fork 9
/
variables-backup.tf
324 lines (272 loc) · 10.1 KB
/
variables-backup.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
###############################
# Azure Backup flags
###############################
variable "backup_vm_enabled" {
description = "Whether the Virtual Machines backup is enabled."
type = bool
default = false
}
variable "backup_file_share_enabled" {
description = "Whether the File Share backup is enabled."
type = bool
default = false
}
variable "backup_postgresql_enabled" {
description = "Whether the PostgreSQL backup is enabled."
type = bool
default = false
}
variable "backup_storage_blob_enabled" {
description = "Whether the Storage blob backup is enabled."
type = bool
default = false
}
variable "backup_managed_disk_enabled" {
description = "Whether the Managed Disk backup is enabled."
type = bool
default = false
}
###############################
# Azure Recovery Vault variables
###############################
variable "recovery_vault_sku" {
description = "Azure Recovery Vault SKU. Possible values include: `Standard`, `RS0`. Default to `Standard`."
type = string
default = "Standard"
}
variable "recovery_vault_storage_mode_type" {
description = "The storage type of the Recovery Services Vault. Possible values are `GeoRedundant`, `LocallyRedundant` and `ZoneRedundant`. Defaults to `GeoRedundant`."
type = string
default = "GeoRedundant"
}
variable "recovery_vault_cross_region_restore_enabled" {
description = "Is cross region restore enabled for this Vault? Can only be `true`, when `storage_mode_type` is `GeoRedundant`."
type = bool
default = true
}
variable "recovery_vault_soft_delete_enabled" {
description = "Is soft delete enable for this Vault? Defaults to `true`."
type = bool
default = true
}
variable "recovery_vault_identity_type" {
description = "Azure Recovery Vault identity type. Possible values include: `null`, `SystemAssigned`. Default to `SystemAssigned`."
type = string
default = "SystemAssigned"
}
variable "vm_backup_policy_timezone" {
description = "Specifies the timezone for VM backup schedules. Defaults to `UTC`."
type = string
default = "UTC"
}
variable "vm_backup_policy_time" {
description = "The time of day to perform the VM backup in 24hour format."
type = string
default = "04:00"
}
variable "vm_backup_policy_frequency" {
description = "Specifies the frequency for VM backup schedules. Must be either `Daily` or `Weekly`."
type = string
default = "Daily"
}
variable "vm_backup_policy_type" {
description = "Type of the Backup Policy. Possible values are `V1` and `V2` where `V2` stands for the Enhanced Policy. Defaults to `V1`. Changing this forces a new resource to be created."
type = string
default = "V1"
}
variable "vm_backup_daily_policy_retention" {
description = "The number of daily VM backups to keep. Must be between 7 and 9999."
type = number
default = 30
}
variable "vm_backup_weekly_retention" {
description = "Map to configure the weekly VM backup policy retention according to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/backup_policy_vm#retention_weekly"
type = object({
count = number,
weekdays = list(string),
})
default = null
}
variable "vm_backup_monthly_retention" {
description = "Map to configure the monthly VM backup policy retention according to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/backup_policy_vm#retention_monthly"
type = object({
count = number,
weekdays = list(string),
weeks = list(string),
})
default = null
}
variable "vm_backup_yearly_retention" {
description = "Map to configure the yearly VM backup policy retention according to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/backup_policy_vm#retention_yearly"
type = object({
count = number,
weekdays = list(string),
weeks = list(string),
months = list(string),
})
default = null
}
###############################
# File Share backup
###############################
variable "file_share_backup_policy_timezone" {
description = "Specifies the timezone for file share backup schedules. Defaults to `UTC`."
type = string
default = "UTC"
}
variable "file_share_backup_policy_time" {
description = "The time of day to perform the file share backup in 24hour format."
type = string
default = "04:00"
}
variable "file_share_backup_daily_policy_retention" {
description = "The number of daily file share backups to keep. Must be between 7 and 9999."
type = number
default = 30
}
variable "file_share_backup_policy_frequency" {
description = "Specifies the frequency for file_share backup schedules. Must be either `Daily` or `Weekly`."
type = string
default = "Daily"
}
variable "file_share_backup_weekly_retention" {
description = "Map to configure the weekly File Share backup policy retention according to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/backup_policy_file_share#retention_weekly"
type = object({
count = number,
weekdays = list(string),
})
default = null
}
variable "file_share_backup_monthly_retention" {
description = "Map to configure the monthly File Share backup policy retention according to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/backup_policy_file_share#retention_monthly"
type = object({
count = number,
weekdays = list(string),
weeks = list(string),
})
default = null
}
variable "file_share_backup_yearly_retention" {
description = "Map to configure the yearly File Share backup policy retention according to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/backup_policy_file_share#retention_yearly"
type = object({
count = number,
weekdays = list(string),
weeks = list(string),
months = list(string),
})
default = null
}
###############################
# Azure Backup Vault variables
###############################
variable "backup_vault_datastore_type" {
description = "Type of data store used for the Backup Vault."
type = string
default = "VaultStore"
}
variable "backup_vault_geo_redundancy_enabled" {
description = "Whether the geo redundancy is enabled no the Backup Vault."
type = bool
default = true
}
variable "backup_vault_identity_type" {
description = "Azure Backup Vault identity type. Possible values include: `null`, `SystemAssigned`. Default to `SystemAssigned`."
type = string
default = "SystemAssigned"
}
###############################
# Managed disk backup
###############################
variable "managed_disk_backup_policy_time" {
description = "The time of day to perform the Managed Disk backup in 24 hours format (eg 04:00)."
type = string
default = "04:00"
}
variable "managed_disk_backup_policy_interval_in_hours" {
description = "The Managed Disk backup interval in hours."
type = string
default = 24
}
variable "managed_disk_backup_policy_retention_in_days" {
description = "The number of days to keep the Managed Disk backup."
type = number
default = 30
}
variable "managed_disk_backup_daily_policy_retention_in_days" {
description = "The number of days to keep the first daily Managed Disk backup."
type = number
default = null
}
variable "managed_disk_backup_weekly_policy_retention_in_weeks" {
description = "The number of weeks to keep the first weekly Managed Disk backup."
type = number
default = null
}
###############################
# PostgreSQL backup
###############################
variable "postgresql_backup_policy_time" {
description = "The time of day to perform the Postgresql backup in 24 hours format (eg 04:00)."
type = string
default = "04:00"
}
variable "postgresql_backup_policy_interval_in_hours" {
description = "The Postgresql backup interval in hours."
type = string
default = 24
}
variable "postgresql_backup_policy_retention_in_days" {
description = "The number of days to keep the Postgresql backup."
type = number
default = 30
}
variable "postgresql_backup_daily_policy_retention_in_days" {
description = "The number of days to keep the first daily Postgresql backup."
type = number
default = null
}
variable "postgresql_backup_weekly_policy_retention_in_weeks" {
description = "The number of weeks to keep the first weekly Postgresql backup."
type = number
default = null
}
variable "postgresql_backup_monthly_policy_retention_in_months" {
description = "The number of months to keep the first monthly Postgresql backup."
type = number
default = null
}
###############################
# Storage blob backup
###############################
variable "storage_blob_backup_policy_retention_in_days" {
description = "The number of days to keep the Storage blob backup."
type = number
default = 30
}
###############################
# Diagnostic Settings
###############################
variable "backup_logs_destinations_ids" {
type = list(string)
description = <<EOD
List of destination resources IDs for logs diagnostic destination.
Can be `Storage Account`, `Log Analytics Workspace` and `Event Hub`. No more than one of each can be set.
If you want to use Azure EventHub as a destination, you must provide a formatted string containing both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the <code>|</code> character.
EOD
default = []
}
variable "backup_logs_categories" {
type = list(string)
description = "Log categories to send to destinations."
default = null
}
variable "backup_logs_metrics_categories" {
type = list(string)
description = "Metrics categories to send to destinations."
default = null
}
variable "backup_diagnostic_settings_custom_name" {
description = "Custom name of the diagnostics settings, name will be 'default' if not set."
type = string
default = "default"
}