added grafana module

This commit is contained in:
Stanislav Kopp 2025-07-10 11:28:59 +02:00
parent 878ecba717
commit 7c9e84971e
38 changed files with 583 additions and 0 deletions

View file

@ -0,0 +1,11 @@
resource "grafana_data_source" "this" {
type = "prometheus"
name = var.datasource_name
url = var.datasource_url
basic_auth_enabled = true
basic_auth_username = var.datasource_username
secure_json_data_encoded = jsonencode({
basicAuthPassword = var.datasource_password
})
}

View file

@ -0,0 +1,3 @@
output "datasource_uid" {
value = grafana_data_source.this.uid
}

View file

@ -0,0 +1,8 @@
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
version = "= 3.25.4"
}
}
}

View file

@ -0,0 +1,18 @@
# Grafana contact point
variable "datasource_url" {
type = string
}
variable "datasource_name" {
type = string
}
variable "datasource_username" {
type = string
sensitive = true
}
variable "datasource_password" {
type = string
sensitive = true
}