Skip to content

Commit

Permalink
Updating module
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-cr-13 committed May 13, 2024
1 parent ccf1ac0 commit e063626
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions generic/grafana/alerts/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ resource "grafana_rule_group" "this" {
interval_seconds = 180

dynamic "rule" {
for_each = var.rules != null ? toset(keys(var.rules)) : []
for_each = var.rules != null ? len(var.rules) : []

content {
name = var.rules[rule.key].name
condition = var.rules[rule.key].condition

dynamic "data" {
for_each = var.rules[rule.key].data != null ? toset(keys(var.rules[rule.key].data)) : []
for_each = var.rules[rule.key].data != null ? len(var.rules[rule.key].data) : []

content {
ref_id = var.rules[rule.key].data[data.key].ref_id
Expand Down
8 changes: 4 additions & 4 deletions generic/grafana/alerts/variabels.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ variable "name" {

variable "rules" {
description = "Rules for the grafana alerts"
type = object({
type = list(object({
name = string
condition = string
data = object({
data = list(object({
ref_id = string
time_range_start = number
time_range_end = number
datasource_uid = string
model = string
})
}))
no_data_state = string
exec_err_state = string
summary = string
})
}))
}
6 changes: 3 additions & 3 deletions generic/grafana/setup/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ variable "grafana_url" {

variable "contact_point_name" {
type = string
description = "Name for the "
description = "Name for the contact settings "
}

variable "slack_config" {
description = "The slack configuration for the contact point"
type = object({
disable_resolve_message = bool
mention_channel = string
mention_groups = list(string)
mention_users = list(string)
mention_groups = string
mention_users = string
text = string
title = string
url = string
Expand Down

0 comments on commit e063626

Please sign in to comment.