-
Notifications
You must be signed in to change notification settings - Fork 18
/
rds_db_cluster_snapshot_report_encryption.sp
62 lines (49 loc) · 1.39 KB
/
rds_db_cluster_snapshot_report_encryption.sp
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
dashboard "rds_db_cluster_snapshot_encryption_report" {
title = "AWS RDS DB Cluster Snapshot Encryption Report"
documentation = file("./dashboards/rds/docs/rds_db_cluster_snapshot_report_encryption.md")
tags = merge(local.rds_common_tags, {
type = "Report"
category = "Encryption"
})
container {
card {
query = query.rds_db_cluster_snapshot_count
width = 3
}
card {
query = query.rds_db_cluster_snapshot_unencrypted_count
width = 3
}
}
table {
column "Account ID" {
display = "none"
}
column "ARN" {
display = "none"
}
column "DB Cluster Snapshot Identifier" {
href = "${dashboard.rds_db_cluster_snapshot_detail.url_path}?input.db_cluster_snapshot_arn={{.ARN | @uri}}"
}
query = query.rds_db_cluster_snapshot_encryption_table
}
}
query "rds_db_cluster_snapshot_encryption_table" {
sql = <<-EOQ
select
s.db_cluster_snapshot_identifier as "DB Cluster Snapshot Identifier",
case when storage_encrypted then 'Enabled' else null end as "Encryption",
s.kms_key_id as "KMS Key ID",
a.title as "Account",
s.account_id as "Account ID",
s.region as "Region",
s.arn as "ARN"
from
aws_rds_db_cluster_snapshot as s,
aws_account as a
where
s.account_id = a.account_id
order by
s.db_cluster_snapshot_identifier;
EOQ
}