From ae79eda74581e53e0669ef61026b97fd77194545 Mon Sep 17 00:00:00 2001 From: Stanislav Kopp Date: Wed, 30 Jul 2025 21:49:33 +0200 Subject: [PATCH] renamed google-chat to gchat --- grafana/README.md | 10 +++++----- grafana/contact-point-gchat/main.tf | 6 +++--- grafana/contact-point-gchat/variables.tf | 6 +++--- .../examples/templates/google-chat-body-template.tmpl | 2 +- .../examples/templates/google-chat-title-template.tmpl | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/grafana/README.md b/grafana/README.md index b129b6a..b9f995b 100644 --- a/grafana/README.md +++ b/grafana/README.md @@ -20,9 +20,9 @@ module "datasource" { } # Alert Receiver / Contact Point -module "google-chat-contact-point" { +module "gchat-contact-point" { source = "git::https://commerce-platform.git.onstackit.cloud/commerce-platform-public/terraform-modules//grafana/contact-point-gchat?ref=main" - google-chat-url = var.google_chat_url + gchat-url = var.google_chat_url contact-point-name = "gchat" } @@ -45,11 +45,11 @@ module "message-templates" { module "notification-policy" { source = "git::https://commerce-platform.git.onstackit.cloud/commerce-platform-public/terraform-modules//grafana/notification-policy?ref=main" - default_contact_point_uid = module.google-chat-contact-point.contact_name + default_contact_point_uid = module.gchat-contact-point.contact_name group_by = ["alertname"] folder_policies = { - "Alerts" = module.google-chat-contact-point.contact_name + "Alerts" = module.gchat-contact-point.contact_name } } @@ -59,7 +59,7 @@ module "alerting" { alerts_dir = "alerts" default_datasource_uid = module.datasource.datasource_uid - default_receiver = module.google-chat-contact-point.contact_name + default_receiver = module.gchat-contact-point.contact_name default_folder_uid = module.alert-folder.folder_uid default_interval_seconds = 60 disable_provenance = true diff --git a/grafana/contact-point-gchat/main.tf b/grafana/contact-point-gchat/main.tf index 1e27c62..eb21706 100644 --- a/grafana/contact-point-gchat/main.tf +++ b/grafana/contact-point-gchat/main.tf @@ -2,8 +2,8 @@ resource "grafana_contact_point" "this" { name = var.contact-point-name googlechat { - url = var.google-chat-url - message = "{{ template \"google-chat-body-template\" . }}" - title = "{{ template \"google-chat-title-template\" . }}" + url = var.gchat-url + message = "{{ template \"gchat-body-template\" . }}" + title = "{{ template \"gchat-title-template\" . }}" } } \ No newline at end of file diff --git a/grafana/contact-point-gchat/variables.tf b/grafana/contact-point-gchat/variables.tf index 0548cbe..9b9c48c 100644 --- a/grafana/contact-point-gchat/variables.tf +++ b/grafana/contact-point-gchat/variables.tf @@ -1,11 +1,11 @@ # Grafana contact point -variable "google-chat-url" { - description = "google-chat-webhook url" +variable "gchat-url" { + description = "gchat-webhook url" type = string sensitive = true } variable "contact-point-name" { - description = "google-chat-contact-point-name" + description = "gchat-contact-point-name" type = string } \ No newline at end of file diff --git a/grafana/examples/templates/google-chat-body-template.tmpl b/grafana/examples/templates/google-chat-body-template.tmpl index 9c02a8f..15385a3 100644 --- a/grafana/examples/templates/google-chat-body-template.tmpl +++ b/grafana/examples/templates/google-chat-body-template.tmpl @@ -1,4 +1,4 @@ -{{ define "google-chat-body-template" -}} +{{ define "gchat-body-template" -}} {{- $alerts := .Alerts }} {{- if not $alerts }}{{ $alerts = . }}{{ end }} diff --git a/grafana/examples/templates/google-chat-title-template.tmpl b/grafana/examples/templates/google-chat-title-template.tmpl index 5bbe8bc..45aa607 100644 --- a/grafana/examples/templates/google-chat-title-template.tmpl +++ b/grafana/examples/templates/google-chat-title-template.tmpl @@ -1,4 +1,4 @@ -{{ define "google-chat-title-template" -}} +{{ define "gchat-title-template" -}} {{- if eq .Status "firing" -}} 🔥 Firing: {{- else if eq .Status "resolved" -}}