tellerops / teller

Cloud native secrets management for developers - never leave your command line for secrets.
https://github.com/tellerops/teller
Apache License 2.0
2.8k stars 183 forks source link

Variable rendering error in v2.0.7 #281

Closed jderieg closed 3 months ago

jderieg commented 3 months ago

Teller was functioning correctly using variables in my yml file, until I upgraded to version 2.0.7. After upgrading I get the following error:

Error: Failed to render '__tera_one_off'

Caused by:
    Variable `env_prefix` not found in context while rendering '__tera_one_off'

Location:
    /tmp/teller-20240519-15158-k6qv7l/teller-2.0.7/teller-cli/src/cli.rs:218:18

My teller.yml file looks like this:

project: test

opts:
  env_prefix: env:ENV_PREFIX
  env_devregion: env:DEVOPS_REGION

providers:
  hashicorp_vault:
    env:
      TF_VAR_nr_license_key:
        path: "{{env_prefix}}-test-secrets/data/newrelic"
        field: nr_license_key
      TF_VAR_nr_api_key:
        path: "{{env_prefix}}-test-secrets/data/newrelic"
        field: nr_api_key
...

ENV_PREFIX and DEVOPS_REGION are env vars that are predefined on my system.

jondot commented 3 months ago

Hi Please notice that Teller 2.0 is a complete rewrite, and so there are a different config templating constructs.

jderieg commented 3 months ago

OK. Looks like I need to do a rework on my teller config file due to the tera templating system. Thanks for the pointer. I'll close this issue.