From 854c8b5a0594b67d107dd8c97643a4533216e888 Mon Sep 17 00:00:00 2001 From: ajeesh-rajan <117838972+ajeesh-rajan@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:17:01 +0530 Subject: [PATCH] Update main.tf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Got the below error and so adding path value to correct it. │ Error: Invalid function argument │ │ on .terraform/modules/kube-prometheus-stack/terraform-modules/aws/helm/kube-prometheus-stack/main.tf line 17, in resource "helm_release" "helm_chart": │ 17: templatefile("./values_local.yaml", { │ 18: enable_grafana_aws_role = var.enable_iam_assumable_role_grafana │ 19: aws_account_id = var.aws_account_id │ 20: role_name = local.k8s_service_account_name │ 21: }), │ ├──────────────── │ │ while calling templatefile(path, vars) │ │ Invalid value for "path" parameter: no file exists at │ "./values_local.yaml"; this function works only with files that are │ distributed as part of the configuration source code, so if this file will │ be created by a resource in this configuration you must instead obtain this │ result from an attribute of that resource. --- terraform-modules/aws/helm/kube-prometheus-stack/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-modules/aws/helm/kube-prometheus-stack/main.tf b/terraform-modules/aws/helm/kube-prometheus-stack/main.tf index 9d82bd751..e6872fd4b 100644 --- a/terraform-modules/aws/helm/kube-prometheus-stack/main.tf +++ b/terraform-modules/aws/helm/kube-prometheus-stack/main.tf @@ -14,7 +14,7 @@ resource "helm_release" "helm_chart" { values = [ # templatefile("${path.module}/values.yaml", { - templatefile("./values_local.yaml", { + templatefile("${path.module}/values_local.yaml", { enable_grafana_aws_role = var.enable_iam_assumable_role_grafana aws_account_id = var.aws_account_id role_name = local.k8s_service_account_name