diff --git a/modules/helm_chart/helm-chart.json b/modules/helm_chart/helm-chart.json index aad154007..ea4156137 100644 --- a/modules/helm_chart/helm-chart.json +++ b/modules/helm_chart/helm-chart.json @@ -21,6 +21,10 @@ "description": "Create namespace as well.", "default": false }, + "release_name": { + "type": "string", + "description": "The name the chart installation is to have." + }, "atomic": { "type": "boolean", "description": "If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used.", diff --git a/modules/helm_chart/helm-chart.yaml b/modules/helm_chart/helm-chart.yaml index eb4cd068d..fc16d1512 100644 --- a/modules/helm_chart/helm-chart.yaml +++ b/modules/helm_chart/helm-chart.yaml @@ -22,6 +22,11 @@ inputs: Note that you don't need to use `/` - as repo is specified separately. Just do ``. If you're using a local chart, then this will be the path to the chart. default: null + - name: release_name + user_facing: true + validator: str(required=False) + description: The name the chart installation is to have. + default: null - name: repository user_facing: true validator: str(required=False) diff --git a/modules/helm_chart/tf_module/main.tf b/modules/helm_chart/tf_module/main.tf index f7f0ce434..26d951d5a 100644 --- a/modules/helm_chart/tf_module/main.tf +++ b/modules/helm_chart/tf_module/main.tf @@ -3,7 +3,7 @@ resource "helm_release" "remote_chart" { chart = var.chart repository = var.repository version = var.chart_version - name = "${var.layer_name}-${var.module_name}" + name = var.release_name == null ? var.chart : var.release_name atomic = var.atomic cleanup_on_fail = var.cleanup_on_fail namespace = var.namespace @@ -13,6 +13,9 @@ resource "helm_release" "remote_chart" { dependency_update = var.dependency_update wait = var.wait max_history = var.max_history + lifecycle { + ignore_changes = [name] + } } diff --git a/modules/helm_chart/tf_module/variables.tf b/modules/helm_chart/tf_module/variables.tf index ad41613f1..e7bc1a211 100644 --- a/modules/helm_chart/tf_module/variables.tf +++ b/modules/helm_chart/tf_module/variables.tf @@ -85,3 +85,5 @@ variable "dependency_update" { variable "max_history" { type = number } + +variable "release_name" {}