Skip to content

Conversation

@ajeesh-rajan
Copy link

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.

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.
Copy link
Author

@ajeesh-rajan ajeesh-rajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added path.module to get the yaml file read from the PWD

@ajeesh-rajan ajeesh-rajan marked this pull request as draft March 26, 2024 04:55
@ajeesh-rajan ajeesh-rajan marked this pull request as ready for review March 26, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant