Apply terraform fmt for CI
Some checks failed
terraform-dev / validate (push) Failing after 47s
terraform-dev / plan (push) Has been skipped
terraform-dev / apply (push) Has been skipped

This commit is contained in:
Alexandr
2026-03-25 07:31:02 +03:00
parent ed66d17b70
commit 8f0f9b7f47
25 changed files with 317 additions and 317 deletions

View File

@ -18,9 +18,9 @@ resource "grafana_contact_point" "contact_points" {
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
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
}
}
}

View File

@ -1,4 +1,4 @@
output "contact_point_ids" {
description = "Mapping of contact point names to their IDs"
value = { for k, v in grafana_contact_point.contact_points : k => v.id }
value = { for k, v in grafana_contact_point.contact_points : k => v.id }
}

View File

@ -1,6 +1,6 @@
variable "contact_points" {
description = "List of contact points for Grafana alerts"
type = list(object({
type = list(object({
name = string
type = string
settings = map(string)

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,22 +1,22 @@
locals {
# Group folders by whether they should keep manual changes or be protected from destruction
folders_ignore_only = {
for group in var.groups : group.dashboard_alert_group_name => group
for group in var.groups : group.dashboard_alert_group_name => group
if lookup(group, "keep_manual_changes", false) && !lookup(group, "prevent_destroy_on_recreate", false)
}
folders_protect_only = {
for group in var.groups : group.dashboard_alert_group_name => group
for group in var.groups : group.dashboard_alert_group_name => group
if !lookup(group, "keep_manual_changes", false) && lookup(group, "prevent_destroy_on_recreate", false)
}
folders_ignore_and_protect = {
for group in var.groups : group.dashboard_alert_group_name => group
for group in var.groups : group.dashboard_alert_group_name => group
if lookup(group, "keep_manual_changes", false) && lookup(group, "prevent_destroy_on_recreate", false)
}
folders_standard = {
for group in var.groups : group.dashboard_alert_group_name => group
for group in var.groups : group.dashboard_alert_group_name => group
if !lookup(group, "keep_manual_changes", false) && !lookup(group, "prevent_destroy_on_recreate", false)
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -14,7 +14,7 @@ locals {
parent_folder_name = length(split("/", group.dashboard_alert_group_name)) > 1 ? join("/", slice(split("/", group.dashboard_alert_group_name), 0, length(split("/", group.dashboard_alert_group_name)) - 1)) : null
folder_title = length(split("/", group.dashboard_alert_group_name)) > 1 ? element(split("/", group.dashboard_alert_group_name), length(split("/", group.dashboard_alert_group_name)) - 1) : group.dashboard_alert_group_name
# Get parent folder UID from parent group's folder_uid
parent_folder_uid = length(split("/", group.dashboard_alert_group_name)) > 1 ? try(local.groups_by_name[join("/", slice(split("/", group.dashboard_alert_group_name), 0, length(split("/", group.dashboard_alert_group_name)) - 1))].folder_uid, null) : null
parent_folder_uid = length(split("/", group.dashboard_alert_group_name)) > 1 ? try(local.groups_by_name[join("/", slice(split("/", group.dashboard_alert_group_name), 0, length(split("/", group.dashboard_alert_group_name)) - 1))].folder_uid, null) : null
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,11 +1,11 @@
variable "contact_points" {
description = "List of contact points"
type = list(object({
name = string
type = string
is_default = optional(bool, false)
labels = optional(map(string))
settings = map(string)
name = string
type = string
is_default = optional(bool, false)
labels = optional(map(string))
settings = map(string)
}))
}
@ -46,31 +46,31 @@ variable "repeat_interval" {
variable "notification_policies" {
description = "Routing rules for specific label sets"
type = list(object({
type = list(object({
contact_point = string
continue = optional(bool)
group_by = optional(list(string))
group_wait = optional(string)
group_interval = optional(string)
repeat_interval = optional(string)
matchers = list(object({
matchers = list(object({
label = string
match = string # Allowed operators are = for equality, != for negated equality, =~ for regex equality, and !~ for negated regex equality
value = string
}))
policies = optional(list(object({
policies = optional(list(object({
contact_point = string
continue = optional(bool)
group_by = optional(list(string))
group_wait = optional(string)
group_interval = optional(string)
repeat_interval = optional(string)
matchers = list(object({
matchers = list(object({
label = string
match = string
value = string
}))
})), [])
}))
default = []
default = []
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}

View File

@ -1,7 +1,7 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
source = "grafana/grafana"
}
}
}