-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.tf.gotf
69 lines (54 loc) · 1.8 KB
/
main.tf.gotf
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
terraform {
required_providers {
sumologic = {
source = "sumologic/sumologic"
}
}
}
resource "sumologic_slo_folder" "slo_root_folder" {
name = "{{.SLORootFolder}}"
description = "Root folder for native SLOs created with slogen"
}
resource "sumologic_monitor_folder" "slo_monitor_root_folder" {
name = "{{.SLOMonitorRootFolder}}"
description = "Root folder for SLO based monitors created with slogen"
}
module "slos" {
source = "./slos"
slo_root_folder_id = sumologic_slo_folder.slo_root_folder.id
slo_monitor_root_folder_id = sumologic_monitor_folder.slo_monitor_root_folder.id
}
{{- if not .OnlyNative }}
/// legacy sumo slo's for sloV1Alpha
{{- if .AsModule }}
variable "slogen_dashboards_parent_folder" {}
{{else}}
data "sumologic_personal_folder" "personalFolder" {}
{{- end}}
resource "sumologic_folder" "slo_dash_root_folder" {
name = "{{.DashFolder}}"
description = "Your SLO dashboards created with slogen"
{{- if .AsModule }}
parent_id = var.slogen_dashboards_parent_folder
{{else}}
parent_id = data.sumologic_personal_folder.personalFolder.id
{{- end}}
}
resource "sumologic_monitor_folder" "slo_mon_root_folder" {
name = "{{.MonitorFolder}}"
description = "Root folder for SLO monitors created with slogen"
}
module "slg_tf_views" {
source = "./views"
}
module "slg_tf_dashboards" {
source = "./dashboards"
slo_dash_root_folder_id = sumologic_folder.slo_dash_root_folder.id
depends_on = [module.slg_tf_views]
}
module "slg_tf_monitors" {
source = "./monitors"
slo_mon_root_folder_id = sumologic_monitor_folder.slo_mon_root_folder.id
depends_on = [module.slg_tf_views]
}
{{- end }}