Skip to content

Update main.tf #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant