aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.terraform/1n_nmd/grafana/main.tf
blob: b67ba0398531a4ee24e7f64b3c0fafcc6ecf7103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
locals {
  datacenters = join(",", var.nomad_datacenters)
}

data "template_file" "nomad_job_grafana" {
  template    = file("${path.module}/conf/nomad/grafana.hcl")
  vars        = {
    datacenters        = local.datacenters
    job_name           = var.grafana_job_name
    use_canary         = var.grafana_use_canary
    group_count        = var.grafana_group_count
    service_name       = var.grafana_service_name
    use_vault_provider = var.grafana_vault_secret.use_vault_provider
    image              = var.grafana_container_image
    cpu                = var.grafana_cpu
    mem                = var.grafana_mem
    port               = var.grafana_port
  }
}

resource "nomad_job" "nomad_job_grafana" {
  jobspec     = data.template_file.nomad_job_grafana.rendered
  detach      = false
}