-
Notifications
You must be signed in to change notification settings - Fork 0
/
prometheus.tf
43 lines (37 loc) · 1.14 KB
/
prometheus.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# variables
variable "install_prometheus" {
description = "Install Prometheus"
type = bool
default = false
}
variable "prometheus" {
description = "Map for overriding Prometheus Helm chart settings"
type = object({
name = optional(string, "prometheus")
repository = optional(string, "oci://cr.yandex/yc-marketplace/yandex-cloud/prometheus")
chart = optional(string, "kube-prometheus-stack")
version = optional(string, "57.2.0-1")
namespace = optional(string, "prometheus")
prometheus_workspace_id = optional(string)
api_key_value = optional(string)
})
default = {}
}
# helm
resource "helm_release" "prometheus" {
count = var.install_prometheus ? 1 : 0
name = var.prometheus.name
repository = var.prometheus.repository
chart = var.prometheus.chart
version = var.prometheus.version
namespace = var.prometheus.namespace
create_namespace = true
values = [
yamlencode(
{
prometheusWorkspaceId = tostring(var.prometheus.prometheus_workspace_id)
iam_api_key_value = tostring(var.prometheus.api_key_value)
}
)
]
}