Apply terraform fmt for CI
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 }
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 = []
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
grafana = {
|
||||
source = "grafana/grafana"
|
||||
source = "grafana/grafana"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user