Skip to content

Terraform example failed #497

Open
Open
@iamhsa

Description

Current Behavior

When I execute terraform plan in example/terraform, the plan failed (see below).

❯ terraform plan -no-color
data.external.helm-secrets: Reading...

Planning failed. Terraform encountered an error while generating this plan.


Error: External Program Execution Failed

  with data.external.helm-secrets,
  on helm.tf line 2, in data "external" "helm-secrets":
   2:   program = ["helm", "secrets", "terraform", "--terraform", "../../examples/sops/secrets.yaml"]

The data source received an unexpected error while attempting to execute the program.

Program: /usr/sbin/helm
Error Message: Error: unknown command "terraform" for "helm"
Run 'helm --help' for usage.
Error: plugin "secrets" exited with error

State: exit status 1

Expected Behavior

When I run terraform plan, I want to see the execution plan

Steps To Reproduce

1. git clone [email protected]:jkroepke/helm-secrets.git
2. cd example/terraform
3. terraform init
4. terraform plan
5. See the error

Environment

  • Helm Version: v3.17.0+g301108e
  • Helm Secrets Version: v4.6.2
  • ArgoCD Version : N/A
  • OS: N/A
  • Shell: zsh

Anything else?

It seems there is a wrong argument for helm secret command

I propose this patch :

--- a/examples/terraform/helm.tf
+++ b/examples/terraform/helm.tf
@@ -1,5 +1,5 @@
 data "external" "helm-secrets" {
-  program = ["helm", "secrets", "terraform", "--terraform", "../../examples/sops/secrets.yaml"]
+  program = ["helm", "secrets", "decrypt", "--terraform", "../../examples/sops/secrets.yaml"]
 }

 resource "helm_release" "example" {

I can also make a PR from https://github.com/iamhsa/helm-secrets/tree/fix-terraform-example

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions