variable "grafana_url" {
  description = "Grafana base URL."
  type        = string
  default     = "https://graphs.burrow.net"
}

variable "grafana_auth" {
  description = "Grafana API token or basic auth in username:password form. Prefer GRAFANA_AUTH in CI."
  type        = string
  default     = null
  sensitive   = true
}

variable "manage_grafana_dashboards" {
  description = "Manage Grafana folders and dashboards through the Grafana API."
  type        = bool
  default     = false
}

variable "grafana_folders" {
  description = "Grafana folders to create before dashboards."
  type = map(object({
    title = string
    uid   = optional(string)
  }))
  default = {
    burrow = {
      title = "Burrow"
      uid   = "burrow"
    }
  }
}

variable "grafana_dashboards" {
  description = "Grafana dashboards to manage from checked-in JSON."
  type = map(object({
    path      = string
    folder    = optional(string)
    message   = optional(string, "Managed by Burrow OpenTofu")
    overwrite = optional(bool, true)
  }))
  default = {
    burrow-overview = {
      path   = "../../services/grafana/dashboards/burrow-overview.json"
      folder = "burrow"
    }
    burrow-headscale = {
      path   = "../../services/grafana/dashboards/headscale.json"
      folder = "burrow"
    }
    burrow-observability = {
      path   = "../../services/grafana/dashboards/observability.json"
      folder = "burrow"
    }
  }
}
