forked from turbot/steampipe-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.sp
51 lines (49 loc) · 1.14 KB
/
mod.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
mod "local" {
title = "my-aws-thrifty"
require {
mod "github.com/turbot/steampipe-mod-aws-thrifty" {
version = "latest"
}
}
}
locals {
hub_path = "https://hub.steampipe.io/mods/turbot/aws_thrifty"
}
dashboard "All-controls-with-descriptions" {
table {
sql = <<EOQ
with controls as (
select
(regexp_matches(source_definition, 'query\.([^\.]+)'))[1] as query,
resource_name as control_name,
tags ->> 'service' as service,
(regexp_matches(source_definition, 'description\s*=\s*"([^"]+)'))[1] as description
from
steampipe_control
order by
query, control_name
)
select
service,
control_name,
query,
description
from
controls
order by
service, control_name
EOQ
column "control_name" {
href = "${local.hub_path}{{'/controls/control.' + .'control_name'}}"
}
column "query" {
href = "${local.hub_path}{{'/queries/' + .'query'}}"
}
column "description" {
wrap = "all"
}
column "source_definition" {
wrap = "all"
}
}
}