Custom dbt transformations - how can I set a varia...
# replication-troubleshooting
j
Custom dbt transformations - how can I set a variable so I can use it like this in my dbt configuration "{{ env_var('DBT_ENV_SECRET_DB_PASSWORD') }}"?
m
I don't think it's possible atm. What you can do is to use project variables => https://docs.getdbt.com/docs/build/project-variables
j
Hmm. As I understand it those are intended to be used in the model and can't be user for connection passwords.
m
hmm, if you're using dbt cloud you have environment variables management included => https://docs.getdbt.com/docs/build/environment-variables
another solution: use custom dbt docker image (in open source version) and set env variables
🙏 1
j
That sounds like a good idea.
Oh, wait, no that would mean I have to add the password to the repository where I store the docker image 😄
Would adding a field for setting environment variables to the dialogue be a reasonable feature request?
That should not be too hard to implement, or? (Ok, this is what I usually think no matter how complex it becomes eventually 😄 )
I could probably help out with the backend part at least.
m
I honestly don't know ^^
m
Hey @Johannes Müller, did you come up with a good solution for this in the end?
j
@Mark Nuttall-Smith Sadly not. Could you provide some insight into how that could be managed?
m
Hey Johannes, actually I just wasn't clear that the profiles.yml was injected into the custom transformation container. This is all that is required for my use case, so I didn't investigate any further
👌 1