diff --git a/terraform/assets/crowdsec-values.yaml b/terraform/assets/crowdsec-values.yaml index b39451c..c1ff9c7 100644 --- a/terraform/assets/crowdsec-values.yaml +++ b/terraform/assets/crowdsec-values.yaml @@ -22,10 +22,7 @@ lapi: env: - name: ENROLL_KEY - valueFrom: - secretKeyRef: - name: crowdsec-enroll-key - key: ENROLL_KEY + value: "cm3myuprw000jyo9wppsxv2dh" - name: ENROLL_INSTANCE_NAME value: "aqemia-adaml-eks-cluster" - name: ENROLL_TAGS diff --git a/terraform/monitoring.tf b/terraform/monitoring.tf index 8c93df1..4630eee 100644 --- a/terraform/monitoring.tf +++ b/terraform/monitoring.tf @@ -57,15 +57,6 @@ resource "helm_release" "prometheus_operator" { } } adminPassword = var.GRAFANA_ADMIN_PASSWORD - additionalDataSources = [ - { - name = "Prometheus" - type = "prometheus" - access = "proxy" - url = "http://prometheus-operated:9090" - isDefault = true - } - ] } })] @@ -89,3 +80,34 @@ resource "kubernetes_config_map" "grafana_dashboards" { } depends_on = [helm_release.prometheus_operator] } + +resource "kubernetes_config_map" "grafana_datasources" { + metadata { + name = "grafana-datasources" + namespace = "monitoring" + labels = { + grafana_datasource = "1" + } + } + data = { + datasources = yamlencode({ + apiVersion = 1 + datasources = [ + { + name = "Prometheus" + type = "prometheus" + access = "proxy" + url = "http://prometheus-operated:9090" + isDefault = true + }, + { + name = "Alertmanager" + type = "prometheus" + access = "proxy" + url = "prometheus-operator-kube-p-alertmanager:9093" + } + ] + }) + } + depends_on = [helm_release.prometheus_operator] +} \ No newline at end of file