From 0b1faef352ee15621b9239fb13c8a2a56c3cb4dd Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sat, 13 Mar 2021 09:40:45 +0000 Subject: [PATCH] Add prometheus CRD cleanup on destroy. --- step3/infrastructure/prometheus.tf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/step3/infrastructure/prometheus.tf b/step3/infrastructure/prometheus.tf index 0ce8bce..dc722f2 100644 --- a/step3/infrastructure/prometheus.tf +++ b/step3/infrastructure/prometheus.tf @@ -39,6 +39,23 @@ kubectl patch ds prometheus-prometheus-node-exporter --type json -p '[{"op": "re } } +resource "null_resource" "prometheus_crd_on_destroy" { + depends_on = [helm_release.prometheus] + provisioner "local-exec" { + when = destroy + command = <