-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables.tf
More file actions
546 lines (509 loc) · 14.9 KB
/
variables.tf
File metadata and controls
546 lines (509 loc) · 14.9 KB
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
variable "project_name" {
description = "The name of the project this relates to."
type = string
}
variable "environment_name" {
description = "The name of the environment where AWS Backup is configured."
type = string
}
variable "notifications_target_email_address" {
description = "The email address to which backup notifications will be sent via SNS."
type = string
default = ""
}
variable "bootstrap_kms_key_arn" {
description = "The ARN of the bootstrap KMS key used for encryption at rest of the SNS topic."
type = string
}
variable "reports_bucket" {
description = "Bucket to drop backup reports into"
type = string
}
variable "terraform_role_arn" {
description = "ARN of Terraform role used to deploy to account (deprecated, please swap to terraform_role_arns)"
type = string
default = ""
}
variable "terraform_role_arns" {
description = "ARN of Terraform roles used to deploy to account, defaults to caller arn if list is empty"
type = list(string)
default = []
}
variable "deletion_allowed_principal_arns" {
description = "List of ARNs of principals allowed to delete backups."
type = list(string)
default = null
nullable = true
}
variable "restore_testing_plan_algorithm" {
description = "Algorithm of the Recovery Selection Point"
type = string
default = "LATEST_WITHIN_WINDOW"
}
variable "restore_testing_plan_start_window" {
description = "Start window from the scheduled time during which the test should start"
type = number
default = 1
}
variable "restore_testing_plan_scheduled_expression" {
description = "Scheduled Expression of Recovery Selection Point"
type = string
default = "cron(0 1 ? * SUN *)"
}
variable "restore_testing_plan_recovery_point_types" {
description = "Recovery Point Types"
type = list(string)
default = ["SNAPSHOT"]
}
variable "restore_testing_plan_selection_window_days" {
description = "Selection window days"
type = number
default = 7
}
variable "backup_copy_vault_arn" {
description = "The ARN of the destination backup vault for cross-account backup copies."
type = string
default = ""
}
variable "backup_copy_vault_account_id" {
description = "The account id of the destination backup vault for allowing restores back into the source account."
type = string
default = ""
}
variable "backup_plan_config" {
description = "Configuration for backup plans"
type = object({
selection_tag = string
selection_tag_value = optional(string)
selection_tags = optional(list(object({
key = optional(string)
value = optional(string)
})))
compliance_resource_types = list(string)
rules = list(object({
name = string
schedule = string
completion_window = optional(number)
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = optional(number)
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
}))
})
default = {
selection_tag = "BackupLocal"
selection_tag_value = "True"
selection_tags = []
compliance_resource_types = ["S3"]
rules = [
{
name = "daily_kept_5_weeks"
schedule = "cron(0 0 * * ? *)"
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
},
{
name = "weekly_kept_3_months"
schedule = "cron(0 1 ? * SUN *)"
lifecycle = {
delete_after = 90
}
copy_action = {
delete_after = 365
}
},
{
name = "monthly_kept_7_years"
schedule = "cron(0 2 1 * ? *)"
lifecycle = {
cold_storage_after = 30
delete_after = 2555
}
copy_action = {
delete_after = 365
}
},
{
name = "point_in_time_recovery"
schedule = "cron(0 5 * * ? *)"
enable_continuous_backup = true
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
}
]
}
}
variable "backup_plan_config_dynamodb" {
description = "Configuration for backup plans with dynamodb"
type = object({
enable = bool
selection_tag = string
selection_tag_value = optional(string)
selection_tags = optional(list(object({
key = optional(string)
value = optional(string)
})))
compliance_resource_types = list(string)
rules = optional(list(object({
name = string
schedule = string
completion_window = optional(number)
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = number
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
})))
})
default = {
enable = true
selection_tag = "BackupDynamoDB"
selection_tag_value = "True"
selection_tags = []
compliance_resource_types = ["DynamoDB"]
rules = [
{
name = "dynamodb_daily_kept_5_weeks"
schedule = "cron(0 0 * * ? *)"
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
},
{
name = "dynamodb_weekly_kept_3_months"
schedule = "cron(0 1 ? * SUN *)"
lifecycle = {
delete_after = 90
}
copy_action = {
delete_after = 365
}
},
{
name = "dynamodb_monthly_kept_7_years"
schedule = "cron(0 2 1 * ? *)"
lifecycle = {
cold_storage_after = 30
delete_after = 2555
}
copy_action = {
delete_after = 365
}
}
]
}
}
variable "name_prefix" {
description = "Name prefix for vault resources"
type = string
default = null
validation {
condition = var.name_prefix == null || can(regex("^[^0-9]*$", var.name_prefix))
error_message = "The name_prefix must not contain any numbers."
}
}
variable "backup_plan_config_ebsvol" {
description = "Configuration for backup plans with EBS"
type = object({
enable = bool
selection_tag = string
selection_tag_value = optional(string)
selection_tags = optional(list(object({
key = optional(string)
value = optional(string)
})))
compliance_resource_types = list(string)
rules = optional(list(object({
name = string
schedule = string
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = number
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
})))
})
default = {
enable = true
selection_tag = "BackupEBSVol"
compliance_resource_types = ["EBS"]
rules = [
{
name = "ebsvol_daily_kept_5_weeks"
schedule = "cron(0 0 * * ? *)"
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
},
{
name = "ebsvol_weekly_kept_3_months"
schedule = "cron(0 1 ? * SUN *)"
lifecycle = {
delete_after = 90
}
copy_action = {
delete_after = 365
}
},
{
name = "ebsvol_monthly_kept_7_years"
schedule = "cron(0 2 1 * ? *)"
lifecycle = {
cold_storage_after = 30
delete_after = 2555
}
copy_action = {
delete_after = 365
}
}
]
}
}
variable "backup_plan_config_aurora" {
description = "Configuration for backup plans with aurora"
type = object({
enable = bool
selection_tag = string
compliance_resource_types = list(string)
restore_testing_overrides = optional(string)
rules = optional(list(object({
name = string
schedule = string
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = number
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
})))
})
default = {
enable = true
selection_tag = "BackupAurora"
compliance_resource_types = ["Aurora"]
rules = [
{
name = "aurora_daily_kept_5_weeks"
schedule = "cron(0 0 * * ? *)"
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
},
{
name = "aurora_weekly_kept_3_months"
schedule = "cron(0 1 ? * SUN *)"
lifecycle = {
delete_after = 90
}
copy_action = {
delete_after = 365
}
},
{
name = "aurora_monthly_kept_7_years"
schedule = "cron(0 2 1 * ? *)"
lifecycle = {
cold_storage_after = 30
delete_after = 2555
}
copy_action = {
delete_after = 365
}
}
]
}
}
variable "backup_plan_config_parameter_store" {
description = "Configuration for backup plans with parameter store"
type = object({
enable = bool
selection_tag = string
selection_tag_value = optional(string)
selection_tags = optional(list(object({
key = optional(string)
value = optional(string)
})))
lambda_backup_cron = optional(string)
lambda_timeout_seconds = optional(number)
rules = optional(list(object({
name = string
schedule = string
completion_window = optional(number)
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = number
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
})))
})
default = {
enable = true
selection_tag = "BackupParameterStore"
selection_tag_value = "True"
selection_tags = []
lambda_backup_cron = "0 6 * * ? *"
lambda_timeout_seconds = 300
compliance_resource_types = ["S3"]
rules = [
{
name = "daily_kept_5_weeks"
schedule = "cron(0 0 * * ? *)"
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
},
{
name = "weekly_kept_3_months"
schedule = "cron(0 1 ? * SUN *)"
lifecycle = {
delete_after = 90
}
copy_action = {
delete_after = 365
}
},
{
name = "monthly_kept_7_years"
schedule = "cron(0 2 1 * ? *)"
lifecycle = {
cold_storage_after = 30
delete_after = 2555
}
copy_action = {
delete_after = 365
}
},
{
name = "point_in_time_recovery"
schedule = "cron(0 5 * * ? *)"
enable_continuous_backup = true
lifecycle = {
delete_after = 35
}
copy_action = {
delete_after = 365
}
}
]
}
}
variable "iam_role_permissions_boundary" {
description = "Optional permissions boundary ARN for backup role"
type = string
default = "" # Empty by default
}
variable "api_endpoint" {
description = "API endpoint to send post build version notifications to"
type = string
default = ""
}
variable "lambda_copy_recovery_point_enable" {
description = "Flag to enable the copy recovery point lambda (copy recovery point from destination vault back to source)."
type = bool
default = false
}
variable "lambda_copy_recovery_point_poll_interval_seconds" {
description = "Polling interval in seconds for copy job status checks."
type = number
default = 30
}
variable "lambda_copy_recovery_point_max_wait_minutes" {
description = "Maximum number of minutes to wait for a copy job to reach a terminal state before returning running status."
type = number
default = 10
}
variable "lambda_copy_recovery_point_destination_vault_arn" {
description = "Destination vault ARN containing the recovery point to be copied back (the air-gapped vault)."
type = string
default = ""
}
variable "api_token" {
description = "API token to authenticate with the API endpoint"
type = string
default = ""
}
variable "lambda_copy_recovery_point_source_vault_arn" {
description = "Source vault ARN to which the recovery point will be copied back."
type = string
default = ""
}
variable "lambda_copy_recovery_point_assume_role_arn" {
description = "ARN of role in destination account the lambda assumes to initiate the copy job (if required for cross-account)."
type = string
default = ""
}
variable "destination_parameter_store_kms_key_arn" {
description = "The ARN of the KMS key used to encrypt Parameter Store backups."
type = string
default = ""
}
variable "lambda_restore_to_s3_enable" {
description = "Enable the Lambda function to restore Parameter Store backups to S3."
type = bool
default = false
}
variable "lambda_restore_to_s3_poll_interval_seconds" {
description = "Poll interval in seconds for checking the status of the restore job."
type = number
default = 30
}
variable "lambda_restore_to_s3_max_wait_minutes" {
description = "Maximum wait time in minutes for the restore job to complete."
type = number
default = 5
}
variable "enable_logically_air_gapped_vault" {
description = "Enable backing up to logically air-gapped vault for supported resources"
type = bool
default = false
}
variable "logically_air_gapped_vault_lock_min_retention_days" {
description = "The minimum retention period that the logically air-gapped vault retains its recovery points"
type = number
default = 35
}
variable "logically_air_gapped_vault_lock_max_retention_days" {
description = "The maximum retention period that the logically air-gapped vault retains its recovery points"
type = number
default = 365
}
variable "logically_air_gapped_vault_approval_team_arn" {
description = "The ARN of the Multi-party approval Team to be assigned to the logically air-gapped vault"
type = string
default = null
}