diff --git a/environments/dev/Seahorse/main.tf b/environments/dev/Seahorse/main.tf index a0d48e1..d0d91f3 100644 --- a/environments/dev/Seahorse/main.tf +++ b/environments/dev/Seahorse/main.tf @@ -37,8 +37,8 @@ module "grafana_contact_points01" { source = "../../modules/grafana_contact_points" org_id = var.org_id env = var.env - grafana_url = "https://grafana.pvenode.ru/" - contact_points = local.contact_points + grafana_url = "http://192.168.0.106" + contact_points = var.enable_contact_points ? local.contact_points : [] providers = { grafana = grafana.grafana01 } @@ -48,8 +48,8 @@ module "grafana_contact_points01" { module "grafana_notification_policies01" { source = "../../modules/grafana_notification_policies" org_id = var.org_id - contact_points = local.contact_points - notification_policies = var.notification_policies + contact_points = var.enable_contact_points ? local.contact_points : [] + notification_policies = var.enable_contact_points ? var.notification_policies : [] depends_on = [module.grafana_contact_points01] providers = { grafana = grafana.grafana01 diff --git a/environments/dev/Seahorse/providers.tf b/environments/dev/Seahorse/providers.tf index 7f89d5e..8f12fa2 100644 --- a/environments/dev/Seahorse/providers.tf +++ b/environments/dev/Seahorse/providers.tf @@ -14,7 +14,7 @@ data "vault_kv_secret_v2" "secret_int" { # Секреты для работы с provider "grafana" { alias = "grafana01" - url = "https://grafana.pvenode.ru/" + url = "http://192.168.0.106" auth = "admin:${data.vault_kv_secret_v2.secret_int.data["grafana_local_admin_password"]}" insecure_skip_verify = true http_headers = local.grafana_headers diff --git a/environments/dev/Seahorse/terraform.tfvars b/environments/dev/Seahorse/terraform.tfvars index 2de3bdb..d8f185e 100644 --- a/environments/dev/Seahorse/terraform.tfvars +++ b/environments/dev/Seahorse/terraform.tfvars @@ -19,7 +19,8 @@ dashboard_uid_max_length = 40 # - Prevents manual changes in the Grafana UI from conflicting with Terraform-managed alerting resources. # - This setting ensures that any changes made directly in the Grafana UI will not persist for these resources. -disable_provenance = true +disable_provenance = true +enable_contact_points = true # Grafana organization settings as an array of objects organizations = [ diff --git a/environments/dev/Seahorse/variables_auth.tf b/environments/dev/Seahorse/variables_auth.tf index e956359..8fc7ebf 100644 --- a/environments/dev/Seahorse/variables_auth.tf +++ b/environments/dev/Seahorse/variables_auth.tf @@ -19,4 +19,10 @@ variable "env" { type = string } +variable "enable_contact_points" { + description = "Enable creation of Grafana contact points and notification policies" + type = bool + default = false +} + diff --git a/environments/dev/adibrov/main.tf b/environments/dev/adibrov/main.tf index a0d48e1..d0d91f3 100644 --- a/environments/dev/adibrov/main.tf +++ b/environments/dev/adibrov/main.tf @@ -37,8 +37,8 @@ module "grafana_contact_points01" { source = "../../modules/grafana_contact_points" org_id = var.org_id env = var.env - grafana_url = "https://grafana.pvenode.ru/" - contact_points = local.contact_points + grafana_url = "http://192.168.0.106" + contact_points = var.enable_contact_points ? local.contact_points : [] providers = { grafana = grafana.grafana01 } @@ -48,8 +48,8 @@ module "grafana_contact_points01" { module "grafana_notification_policies01" { source = "../../modules/grafana_notification_policies" org_id = var.org_id - contact_points = local.contact_points - notification_policies = var.notification_policies + contact_points = var.enable_contact_points ? local.contact_points : [] + notification_policies = var.enable_contact_points ? var.notification_policies : [] depends_on = [module.grafana_contact_points01] providers = { grafana = grafana.grafana01 diff --git a/environments/dev/adibrov/providers.tf b/environments/dev/adibrov/providers.tf index 7f89d5e..8f12fa2 100644 --- a/environments/dev/adibrov/providers.tf +++ b/environments/dev/adibrov/providers.tf @@ -14,7 +14,7 @@ data "vault_kv_secret_v2" "secret_int" { # Секреты для работы с provider "grafana" { alias = "grafana01" - url = "https://grafana.pvenode.ru/" + url = "http://192.168.0.106" auth = "admin:${data.vault_kv_secret_v2.secret_int.data["grafana_local_admin_password"]}" insecure_skip_verify = true http_headers = local.grafana_headers diff --git a/environments/dev/adibrov/terraform.tfvars b/environments/dev/adibrov/terraform.tfvars index 1e5cca8..edcfcd6 100644 --- a/environments/dev/adibrov/terraform.tfvars +++ b/environments/dev/adibrov/terraform.tfvars @@ -19,7 +19,8 @@ dashboard_uid_max_length = 40 # - Prevents manual changes in the Grafana UI from conflicting with Terraform-managed alerting resources. # - This setting ensures that any changes made directly in the Grafana UI will not persist for these resources. -disable_provenance = true +disable_provenance = true +enable_contact_points = true # Grafana organization settings as an array of objects organizations = [ diff --git a/environments/dev/adibrov/variables_auth.tf b/environments/dev/adibrov/variables_auth.tf index e956359..8fc7ebf 100644 --- a/environments/dev/adibrov/variables_auth.tf +++ b/environments/dev/adibrov/variables_auth.tf @@ -19,4 +19,10 @@ variable "env" { type = string } +variable "enable_contact_points" { + description = "Enable creation of Grafana contact points and notification policies" + type = bool + default = false +} +