-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alerting: Add MQTT notifications receiver
- Loading branch information
1 parent
397e224
commit 02f00e1
Showing
7 changed files
with
378 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
examples/resources/grafana_contact_point/_acc_mqtt_receiver.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Basic MQTT configuration | ||
resource "grafana_contact_point" "mqtt_basic" { | ||
name = "mqtt-basic" | ||
|
||
mqtt { | ||
broker_url = "tcp://localhost:1883" | ||
topic = "grafana/alerts" | ||
qos = 0 | ||
} | ||
} | ||
|
||
# MQTT with authentication | ||
resource "grafana_contact_point" "mqtt_auth" { | ||
name = "mqtt-auth" | ||
|
||
mqtt { | ||
broker_url = "tcp://localhost:1883" | ||
topic = "grafana/alerts" | ||
client_id = "grafana-client" | ||
username = "mqtt-user" | ||
password = "secret123" | ||
message_format = "json" | ||
qos = 1 | ||
} | ||
} | ||
|
||
# MQTT with TLS | ||
resource "grafana_contact_point" "mqtt_tls" { | ||
name = "mqtt-tls" | ||
|
||
mqtt { | ||
broker_url = "ssl://localhost:8883" | ||
topic = "grafana/alerts" | ||
client_id = "grafana-secure" | ||
message_format = "json" | ||
qos = 2 | ||
retain = true | ||
|
||
tls_config { | ||
insecure_skip_verify = false | ||
ca_certificate = file("ca.pem") | ||
client_certificate = file("client-cert.pem") | ||
client_key = file("client-key.pem") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
examples/resources/grafana_contact_point/_acc_receiver_types_11_3.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "grafana_contact_point" "receiver_types" { | ||
name = "Receiver Types since v11.3" | ||
|
||
mqtt { | ||
broker_url = "tcp://localhost:1883" | ||
client_id = "grafana" | ||
topic = "grafana/alerts" | ||
message_format = "json" | ||
username = "user" | ||
password = "password123" | ||
qos = 1 | ||
retain = true | ||
tls_config { | ||
insecure_skip_verify = true | ||
ca_certificate = "ca_cert" | ||
client_certificate = "client_cert" | ||
client_key = "client_key" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.