-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.tf
103 lines (78 loc) · 3.06 KB
/
tasks.tf
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
resource "snowflake_task" "snowalert_alerts_merge_task" {
provider = snowflake.alerting_role
warehouse = local.snowalert_warehouse_name
database = local.snowalert_database_name
schema = local.results_schema
name = "ALERTS_MERGE"
schedule = "USING CRON ${var.alerts_merge_schedule} UTC"
sql_statement = "CALL ${local.results_schema}.${snowflake_procedure.alerts_merge.name}('30m')"
enabled = true
depends_on = [
module.snowalert_grants
]
}
resource "snowflake_task" "snowalert_suppression_merge_task" {
provider = snowflake.alerting_role
warehouse = local.snowalert_warehouse_name
database = local.snowalert_database_name
schema = local.results_schema
name = "SUPPRESSION_MERGE"
after = [snowflake_task.snowalert_alerts_merge_task.name]
sql_statement = "CALL ${local.snowalert_database_name}.${local.results_schema}.${snowflake_procedure.alert_suppressions_runner_without_queries_like.name}()"
enabled = true
depends_on = [
module.snowalert_grants
]
}
resource "snowflake_task" "alert_processor_task" {
provider = snowflake.alerting_role
warehouse = local.snowalert_warehouse_name
database = local.snowalert_database_name
schema = local.results_schema
name = "ALERT_PROCESSOR"
after = [snowflake_task.snowalert_suppression_merge_task.name]
sql_statement = "CALL ${local.results_schema}.${snowflake_procedure.alert_processor_with_default_correlation_period.name}()"
enabled = var.enable_alert_processor
depends_on = [
module.snowalert_grants
]
}
resource "snowflake_task" "alert_dispatcher_task" {
provider = snowflake.alerting_role
warehouse = local.snowalert_warehouse_name
database = local.snowalert_database_name
schema = local.results_schema
name = "ALERT_DISPATCHER"
schedule = "USING CRON ${var.alert_dispatch_schedule} UTC"
sql_statement = "CALL ${local.results_schema}.${snowflake_procedure.alert_dispatcher.name}()"
enabled = true
depends_on = [
module.snowalert_grants
]
}
resource "snowflake_task" "alert_scheduler_task" {
provider = snowflake.alerting_role
warehouse = local.snowalert_warehouse_name
database = local.snowalert_database_name
schema = local.results_schema
name = "ALERT_SCHEDULER"
schedule = "USING CRON ${var.alert_scheduler_schedule} UTC"
sql_statement = "CALL ${local.results_schema}.${snowflake_procedure.alert_scheduler.name}('${local.snowalert_warehouse_name}')"
enabled = true
depends_on = [
module.snowalert_grants
]
}
resource "snowflake_task" "violation_scheduler_task" {
provider = snowflake.alerting_role
warehouse = local.snowalert_warehouse_name
database = local.snowalert_database_name
schema = local.results_schema
name = "VIOLATION_SCHEDULER"
schedule = "USING CRON ${var.violation_scheduler_schedule} UTC"
sql_statement = "CALL ${local.results_schema}.${snowflake_procedure.violation_scheduler.name}('${local.snowalert_warehouse_name}')"
enabled = true
depends_on = [
module.snowalert_grants
]
}