locals {
  app_version = var.tag
  data_folder = "${var.persistent_folder}/prometheus"

  prometheus_config          = coalesce(var.config, file("${path.module}/resources/default.yml"))
  prometheus_config_checksum = md5(local.prometheus_config)

  prometheus_rules = yamlencode({
    groups = [
      {
        name  = "custom-rules"
        rules = var.rules
      }
    ]
  })
  prometheus_rules_checksum = md5(local.prometheus_rules)
}
