From 889b75a4467979029b5c77d95e67d74356e46777 Mon Sep 17 00:00:00 2001 From: Harshit Luthra Date: Sat, 26 Oct 2024 15:34:16 +0530 Subject: [PATCH] feat(terraform): add trigger_helm_update variable to control Helm chart updates Introduce a new variable `trigger_helm_update` to allow users to trigger Helm chart updates. This enhances flexibility by enabling conditional updates based on the variable's value. --- main.tf | 10 +++++----- variables.tf | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.tf b/main.tf index 4363381..dd79b2f 100644 --- a/main.tf +++ b/main.tf @@ -3,12 +3,12 @@ data "aws_eks_cluster_auth" "cluster" { } resource "null_resource" "helm_install" { triggers = { - chart_name = var.chart_name - chart_version = var.chart_version - release_name = var.release_name - namespace = var.namespace + chart_name = var.chart_name + chart_version = var.chart_version + release_name = var.release_name + namespace = var.namespace + update_trigger = var.trigger_helm_update != null ? var.trigger_helm_update : "initial" } - # Add this data source after the existing aws_eks_cluster data source provisioner "local-exec" { command = <<-EOT diff --git a/variables.tf b/variables.tf index d0caaf1..022c7bc 100644 --- a/variables.tf +++ b/variables.tf @@ -54,3 +54,8 @@ variable "set_values" { description = "A map of values to pass to the Helm chart" default = {} } +variable "trigger_helm_update" { + description = "Set this to any value to trigger a Helm chart update" + type = string + default = null +}