For the dbt integration - Is it possible to dynami...
# ask-community
j
For the dbt integration - Is it possible to dynamically set environment variables to parametrize the dbt project's profile?
Copy code
prod:
      dbname: xx
      host: <http://ingress.xxx.net|ingress.xxx.net>
      pass: "{{ env_var('DBT_PASSWORD') }}"
      port: 42
      schema: my_schema
      threads: 1
      type: redshift
      user: my_user
I saw that you can set them during deployment, but it would be nice to pass them when
load_assets_from_dbt_project
is called.
dagster bot responded by community 1
a
I'm using
load_assets_from_dbt_manifest
, but I believe this is the same. The trick is in the configuration of your dbt resource. You can pass a dbt resource with a configured
profiles_dir
. You can then have a
profiles.yml
file in that directory, as you mentioned in your example.
j
Yes, that is how I work around the issue at the moment. I'm just overwriting the
profiles.yml
file instead of using the environment variables directly. It would be cool if the
load
methods would accept environment variables instead.