Add dashboard UID auto-generation and Gitea CI workflow
This commit is contained in:
26
environments/modules/grafana_contact_points/main.tf
Normal file
26
environments/modules/grafana_contact_points/main.tf
Normal file
@ -0,0 +1,26 @@
|
||||
resource "grafana_contact_point" "contact_points" {
|
||||
for_each = { for cp in var.contact_points : "${cp.name}_${cp.type}" => cp }
|
||||
|
||||
org_id = var.org_id
|
||||
name = each.value.name
|
||||
disable_provenance = var.disable_provenance
|
||||
|
||||
dynamic "telegram" {
|
||||
for_each = each.value.type == "telegram" ? [1] : []
|
||||
content {
|
||||
chat_id = each.value.settings["chat_id"]
|
||||
token = each.value.settings["bot_token"]
|
||||
message = local.contact_point_templates[each.value.name].template
|
||||
parse_mode = "HTML"
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "slack" {
|
||||
for_each = each.value.type == "slack" ? [1] : []
|
||||
content {
|
||||
url = each.value.settings["webhook_url"]
|
||||
title = try(local.contact_point_templates[each.value.name].title, null)
|
||||
text = local.contact_point_templates[each.value.name].template
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user