-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathquery_trigger.fp
75 lines (55 loc) · 1.31 KB
/
query_trigger.fp
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
trigger "query" "simple" {
title = "Simple Query Trigger (with param)"
schedule = "* * * * *"
enabled = false
database = param.database_connection
param "database_connection" {
type = connection.steampipe
default = connection.steampipe.default
}
param "sql" {
type = string
default = "select * from aws_s3_bucket"
}
sql = param.sql
param "primary_key" {
type = string
default = "arn"
}
primary_key = param.primary_key
capture "insert" {
pipeline = pipeline.query_trigger_display
args = {
inserted_rows = self.inserted_rows
}
}
capture "update" {
pipeline = pipeline.query_trigger_display
args = {
updated_rows = self.updated_rows
}
}
capture "delete" {
pipeline = pipeline.query_trigger_display
args = {
deleted_rows = self.deleted_rows
}
}
}
pipeline "query_trigger_display" {
param "inserted_rows" {
}
param "updated_rows" {
}
param "deleted_rows" {
}
output "inserted_rows" {
value = param.inserted_rows
}
output "updated_rows" {
value = param.updated_rows
}
output "deleted_rows" {
value = param.deleted_rows
}
}