-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackup_report_plan.tf
More file actions
72 lines (61 loc) · 2.04 KB
/
backup_report_plan.tf
File metadata and controls
72 lines (61 loc) · 2.04 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
# Create the reports
resource "aws_backup_report_plan" "backup_jobs" {
name = replace("${local.resource_name_prefix}_backup_jobs", "-", "_")
description = "Report for showing whether backups ran successfully in the last 24 hours"
report_delivery_channel {
formats = [
"JSON"
]
s3_bucket_name = var.reports_bucket
s3_key_prefix = "backup_jobs"
}
report_setting {
report_template = "BACKUP_JOB_REPORT"
}
}
# Create the restore testing completion reports
resource "aws_backup_report_plan" "backup_restore_testing_jobs" {
name = replace("${local.resource_name_prefix}_backup_restore_testing_jobs", "-", "_")
description = "Report for showing whether backup restore test ran successfully in the last 24 hours"
report_delivery_channel {
formats = [
"JSON"
]
s3_bucket_name = var.reports_bucket
s3_key_prefix = "backup_restore_testing_jobs"
}
report_setting {
report_template = "RESTORE_JOB_REPORT"
}
}
resource "aws_backup_report_plan" "resource_compliance" {
name = replace("${local.resource_name_prefix}_resource_compliance", "-", "_")
description = "Report for showing whether resources are compliant with the framework"
report_delivery_channel {
formats = [
"JSON"
]
s3_bucket_name = var.reports_bucket
s3_key_prefix = "resource_compliance"
}
report_setting {
framework_arns = local.framework_arn_list
number_of_frameworks = length(local.framework_arn_list)
report_template = "RESOURCE_COMPLIANCE_REPORT"
}
}
resource "aws_backup_report_plan" "copy_jobs" {
count = var.backup_copy_vault_arn != "" && var.backup_copy_vault_account_id != "" ? 1 : 0
name = replace("${local.resource_name_prefix}_copy_jobs", "-", "_")
description = "Report for showing whether copies ran successfully in the last 24 hours"
report_delivery_channel {
formats = [
"JSON"
]
s3_bucket_name = var.reports_bucket
s3_key_prefix = "copy_jobs"
}
report_setting {
report_template = "COPY_JOB_REPORT"
}
}