Hi,
I am trying to pass liveness_probe as a variable . But since liveness_probe is a block inside resource, it doesnt work.
this is the variable i am trying to pass,
and this is the actual resource,
resource "kubernetes_deployment" "k8-deploy" {
count = var.enabled == "true" ? 1 : 0
depends_on = [kubernetes_config_map.env-vars]
metadata {
name = var.svc-name
annotations = {
dependency = join(" ", list(module.rds-db-migrate.uid))
}
}
spec {
selector {
match_labels = {
service = var.svc-name
}
}
replicas = var.replicas
template {
metadata {
labels = {
service = var.svc-name
}
}
spec {
container {
name = "${var.svc-name}-container"
image = "${var.container-image}:${var.svc-version}"
port {
container_port = var.svc-port
}
liveness_probe = var.health-check-config
}
}
}
}
}
The actual syntax expects something like this liveness_probe { … }