From 1fd4ba9ea7223e55fce227fd41b73d6cc174e63e Mon Sep 17 00:00:00 2001 From: Jillian Date: Tue, 12 Oct 2021 15:31:47 +0300 Subject: [PATCH] need file first --- main.tf | 11 +---------- outputs.tf | 7 +------ variables.tf | 5 +++++ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/main.tf b/main.tf index 9b7b397..8bad20f 100644 --- a/main.tf +++ b/main.tf @@ -1,14 +1,5 @@ -resource "random_string" "computed_values" { - length = 10 - special = false - lower = true - upper = false - override_special = "" -} - locals { helm_values_files = var.helm_values_files - helm_values_merged_file = abspath("${var.helm_values_dir}/computed-${random_string.computed_values.result}-values.yaml") } resource "null_resource" "merge_yamls" { @@ -23,7 +14,7 @@ resource "null_resource" "merge_yamls" { %{for value_file in local.helm_values_files~} ${value_file} \ %{endfor~} - --output ${local.helm_values_merged_file} + --output ${var.helm_release_merged_values_file} EOT } } diff --git a/outputs.tf b/outputs.tf index 92b7733..0da9d78 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,8 +1,3 @@ -output "helm_values_merged_file" { - description = "Merged values file" - value = local.helm_values_merged_file -} - output "helm_values_files" { description = "Listing the values file for debugging" value = var.helm_values_files @@ -20,6 +15,6 @@ output "merge_helm_values_files_command" { %{for value_file in local.helm_values_files~} ${value_file} \ %{endfor~} - --output ${local.helm_values_merged_file} + --output ${var.helm_release_merged_values_file} EOT } diff --git a/variables.tf b/variables.tf index c95f87e..0b97934 100644 --- a/variables.tf +++ b/variables.tf @@ -8,3 +8,8 @@ variable "helm_values_dir" { type = string description = "Directory to store additional daskhub values files." } + +variable "helm_release_merged_values_file" { + type = string + description = "Path to merged helm files. This path must exist before the module is invoked." +}