Skip to content

Commit cb37f64

Browse files
committed
fix(grafana_terraform): fix subject section
1 parent d3b1234 commit cb37f64

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

app/media/terraform.tfvars

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ use_slack = true
1414
email_contact_point = {
1515
1616
message = "{ len .Alerts.Firing } firing."
17-
subject = "{ template "default.title" .}"
17+
subject = "{{ template "default.title" .}}"
1818
single_email = true
1919
disable_resolve_message = false
2020
}
2121

22-
slack_contact_point =
23-
{
22+
slack_contact_point = {
2423
url = "https://hooks.slack.com/<YOUR_SLACK_WEBHOOK_URL>"
2524
text = <<EOT
2625
{{ len .Alerts.Firing }} alerts are firing
@@ -30,7 +29,7 @@ slack_contact_point =
3029
{{ template "Alert Instance Template" . }}
3130
{{ end }}
3231
EOT
33-
}
32+
}
3433

3534

3635
# Use { template "Alert Instance Template" . } or any other template if you plan # to create one. Otherwise, remove it from the text section of Slack in the above example
@@ -40,17 +39,17 @@ slack_contact_point =
4039
create_message_template = true
4140
message_template_name = "Alert Instance Template"
4241
message_template_content = <<EOT
43-
{ define "Alert Instance Template" }
44-
Firing: { .Labels.alertname }
45-
Silence: { .SilenceURL }
46-
{ end }
42+
{{ define "Alert Instance Template" }}
43+
Firing: {{ .Labels.alertname }}
44+
Silence: {{ .SilenceURL }}
45+
{{ end }}
4746
EOT
47+
4848

4949

5050
# Grafana_Mute_Timing Variables
5151
create_mute_timing = true
52-
mute_timing =
53-
{
52+
mute_timing = {
5453
name = "My Mute Timing"
5554
start = "04:56"
5655
end = "04:57"
@@ -65,8 +64,7 @@ mute_timing =
6564

6665
# Grafana_Notification_Policy Variables
6766
create_notification_policy = true
68-
notification_policy_config =
69-
{
67+
notification_policy_config = {
7068
group_by = ["..."]
7169
group_wait = "45s"
7270
group_interval = "6m"
@@ -76,9 +74,8 @@ notification_policy_config =
7674

7775
policies = []
7876
/* policies = [
79-
80-
{
81-
matchers = [
77+
{
78+
matchers = [
8279
{ label = "mylabel", match = "=", value = "myvalue" },
8380
{ label = "alertname", match = "=", value = "CPU Usage" },
8481
{ label = "Name", match = "=~", value = "host.*|host-b.*" }
@@ -96,7 +93,7 @@ policies = []
9693
continue = false
9794
mute_timings = ["mute_timing_2"]
9895
group_by = ["group2_sub"]
99-
}
96+
}
10097
10198
10299
] */

app/template_generators/terraform/tfvars/grafana.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ def grafana_tfvars(input):
55
grafana_connection = """{
66
"url" = "http://localhost:8080",
77
"auth" = ""
8-
}"""
8+
}
9+
"""
910
slack_contact_point = """{
1011
url = "https://hooks.slack.com/<YOUR_SLACK_WEBHOOK_URL>"
1112
text = <<EOT

0 commit comments

Comments
 (0)