Apply terraform fmt for CI
This commit is contained in:
@ -4,8 +4,8 @@ terraform {
|
||||
source = "grafana/grafana"
|
||||
version = ">= 4.7.0"
|
||||
}
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,46 +5,46 @@ locals {
|
||||
"X-Disable-Provenance" = var.disable_provenance ? "true" : "false"
|
||||
}
|
||||
|
||||
# Contact points configuration
|
||||
contact_points = [
|
||||
{
|
||||
name = "default"
|
||||
type = "slack"
|
||||
is_default = true
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_default"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
# Contact points configuration
|
||||
contact_points = [
|
||||
{
|
||||
name = "default"
|
||||
type = "slack"
|
||||
is_default = true
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_default"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name = "infra-alerts-critical"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_critical"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "infra-alerts-critical"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_critical"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name = "infra-alerts-informational"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_info"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "infra-alerts-informational"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_info"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name = "infra-alerts-test"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_test"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
}
|
||||
]
|
||||
{
|
||||
name = "infra-alerts-test"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_test"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
provider "vault" {
|
||||
provider "vault" {
|
||||
skip_child_token = true
|
||||
}
|
||||
|
||||
data "vault_kv_secret_v2" "secret_ext" { # Секреты для подключения к внешним источникам (mm, clickhouse и т.д.)
|
||||
mount = "app"
|
||||
name = "groups/monitoring/grafana/dev/ext"
|
||||
mount = "app"
|
||||
name = "groups/monitoring/grafana/dev/ext"
|
||||
}
|
||||
|
||||
data "vault_kv_secret_v2" "secret_int" { # Секреты для работы самой графаны
|
||||
|
||||
@ -33,41 +33,41 @@ organizations = [
|
||||
|
||||
|
||||
# Current organization for deploying
|
||||
org_id = "2"
|
||||
org_id = "2"
|
||||
|
||||
# Alert groups configuration
|
||||
groups = [
|
||||
{
|
||||
dashboard_alert_group_name = "System Alerts"
|
||||
folder_uid = "system"
|
||||
alert_definitions_path = "alerts/system"
|
||||
dashboard_path_if_exist = "dashboards/system"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus"]
|
||||
dashboard_alert_group_name = "System Alerts"
|
||||
folder_uid = "system"
|
||||
alert_definitions_path = "alerts/system"
|
||||
dashboard_path_if_exist = "dashboards/system"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus"]
|
||||
},
|
||||
{
|
||||
dashboard_alert_group_name = "Self monitoring"
|
||||
folder_uid = "self-monitoring"
|
||||
alert_definitions_path = "alerts/self-monitoring"
|
||||
dashboard_path_if_exist = "dashboards/self-monitoring"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus-local-1"]
|
||||
dashboard_alert_group_name = "Self monitoring"
|
||||
folder_uid = "self-monitoring"
|
||||
alert_definitions_path = "alerts/self-monitoring"
|
||||
dashboard_path_if_exist = "dashboards/self-monitoring"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus-local-1"]
|
||||
}
|
||||
]
|
||||
# Data sources configuration
|
||||
datasources = [
|
||||
{
|
||||
name = "prometheus"
|
||||
uid = "prometheus"
|
||||
type = "prometheus"
|
||||
url = "http://localhost:8481/select/0/prometheus"
|
||||
access_mode = "proxy"
|
||||
is_default = true
|
||||
basic_auth = false
|
||||
json_data = {
|
||||
timeInterval = "15s"
|
||||
name = "prometheus"
|
||||
uid = "prometheus"
|
||||
type = "prometheus"
|
||||
url = "http://localhost:8481/select/0/prometheus"
|
||||
access_mode = "proxy"
|
||||
is_default = true
|
||||
basic_auth = false
|
||||
json_data = {
|
||||
timeInterval = "15s"
|
||||
}
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
@ -76,79 +76,79 @@ datasources = [
|
||||
|
||||
# Notification policies configuration
|
||||
notification_policies = [
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "disaster"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "critical"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "warning"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "perfomance"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-test"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "status"
|
||||
match = "="
|
||||
value = "test"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "disaster"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "critical"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "warning"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "perfomance"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-test"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "status"
|
||||
match = "="
|
||||
value = "test"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -9,7 +9,7 @@ variable "datasources" {
|
||||
username = optional(string, null)
|
||||
access_mode = string # Access mode: proxy or direct
|
||||
is_default = bool # Set as default source
|
||||
|
||||
|
||||
# Authentication settings
|
||||
basic_auth = optional(bool, false) # Use basic authentication
|
||||
basic_auth_user = optional(string, null) # Username for basic authentication
|
||||
|
||||
@ -4,8 +4,8 @@ terraform {
|
||||
source = "grafana/grafana"
|
||||
version = ">= 4.7.0"
|
||||
}
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,46 +5,46 @@ locals {
|
||||
"X-Disable-Provenance" = var.disable_provenance ? "true" : "false"
|
||||
}
|
||||
|
||||
# Contact points configuration
|
||||
contact_points = [
|
||||
{
|
||||
name = "default"
|
||||
type = "slack"
|
||||
is_default = true
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_default"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
# Contact points configuration
|
||||
contact_points = [
|
||||
{
|
||||
name = "default"
|
||||
type = "slack"
|
||||
is_default = true
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_default"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name = "infra-alerts-critical"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_critical"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "infra-alerts-critical"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_critical"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name = "infra-alerts-informational"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_info"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "infra-alerts-informational"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_info"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name = "infra-alerts-test"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_test"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
}
|
||||
]
|
||||
{
|
||||
name = "infra-alerts-test"
|
||||
type = "slack"
|
||||
is_default = false
|
||||
settings = {
|
||||
webhook_url = data.vault_kv_secret_v2.secret_ext.data["mmwebhook_infra_alerts_test"]
|
||||
template = "../../../modules/grafana_contact_points/template/alerts_message_mm.template"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
provider "vault" {
|
||||
provider "vault" {
|
||||
skip_child_token = true
|
||||
}
|
||||
|
||||
data "vault_kv_secret_v2" "secret_ext" { # Секреты для подключения к внешним источникам (mm, clickhouse и т.д.)
|
||||
mount = "app"
|
||||
name = "groups/monitoring/grafana/dev/ext"
|
||||
mount = "app"
|
||||
name = "groups/monitoring/grafana/dev/ext"
|
||||
}
|
||||
|
||||
data "vault_kv_secret_v2" "secret_int" { # Секреты для работы самой графаны
|
||||
|
||||
@ -33,41 +33,41 @@ organizations = [
|
||||
|
||||
|
||||
# Current organization for deploying
|
||||
org_id = "35"
|
||||
org_id = "35"
|
||||
|
||||
# Alert groups configuration
|
||||
groups = [
|
||||
{
|
||||
dashboard_alert_group_name = "System Alerts"
|
||||
folder_uid = "system"
|
||||
alert_definitions_path = "alerts/system"
|
||||
dashboard_path_if_exist = "dashboards/system"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus"]
|
||||
dashboard_alert_group_name = "System Alerts"
|
||||
folder_uid = "system"
|
||||
alert_definitions_path = "alerts/system"
|
||||
dashboard_path_if_exist = "dashboards/system"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus"]
|
||||
},
|
||||
{
|
||||
dashboard_alert_group_name = "Self monitoring"
|
||||
folder_uid = "self-monitoring"
|
||||
alert_definitions_path = "alerts/self-monitoring"
|
||||
dashboard_path_if_exist = "dashboards/self-monitoring"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus-local-1"]
|
||||
dashboard_alert_group_name = "Self monitoring"
|
||||
folder_uid = "self-monitoring"
|
||||
alert_definitions_path = "alerts/self-monitoring"
|
||||
dashboard_path_if_exist = "dashboards/self-monitoring"
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
alerts_on_datasources_uid = ["prometheus-local-1"]
|
||||
}
|
||||
]
|
||||
# Data sources configuration
|
||||
datasources = [
|
||||
{
|
||||
name = "prometheus"
|
||||
uid = "prometheus"
|
||||
type = "prometheus"
|
||||
url = "http://localhost:8481/select/0/prometheus"
|
||||
access_mode = "proxy"
|
||||
is_default = true
|
||||
basic_auth = false
|
||||
json_data = {
|
||||
timeInterval = "15s"
|
||||
name = "prometheus"
|
||||
uid = "prometheus"
|
||||
type = "prometheus"
|
||||
url = "http://localhost:8481/select/0/prometheus"
|
||||
access_mode = "proxy"
|
||||
is_default = true
|
||||
basic_auth = false
|
||||
json_data = {
|
||||
timeInterval = "15s"
|
||||
}
|
||||
keep_manual_changes = false
|
||||
prevent_destroy_on_recreate = false
|
||||
@ -76,79 +76,79 @@ datasources = [
|
||||
|
||||
# Notification policies configuration
|
||||
notification_policies = [
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "disaster"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "critical"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "warning"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "perfomance"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-test"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "status"
|
||||
match = "="
|
||||
value = "test"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "disaster"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-critical"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "critical"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "warning"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-informational"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "severity"
|
||||
match = "="
|
||||
value = "perfomance"
|
||||
},
|
||||
{
|
||||
label = "team"
|
||||
match = "="
|
||||
value = "infra"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
contact_point = "infra-alerts-test"
|
||||
continue = true
|
||||
matchers = [
|
||||
{
|
||||
label = "status"
|
||||
match = "="
|
||||
value = "test"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -9,7 +9,7 @@ variable "datasources" {
|
||||
username = optional(string, null)
|
||||
access_mode = string # Access mode: proxy or direct
|
||||
is_default = bool # Set as default source
|
||||
|
||||
|
||||
# Authentication settings
|
||||
basic_auth = optional(bool, false) # Use basic authentication
|
||||
basic_auth_user = optional(string, null) # Username for basic authentication
|
||||
|
||||
Reference in New Issue
Block a user