hello! I have a question regarding loading airbyte...
# ask-community
j
hello! I have a question regarding loading airbyte asset definitions at initialization time from the docs it looks like we can use
EnvVar
with
AirbyteResource
to configure a connection to airbyte, but when I try to configure the host, port with
EnvVar
, it looks like it is not using the values specified in
.env
but instead using the name of the
EnvVar
when trying to load asset defs at initialization time. after some reading up here I see that they're retrieved at launch time instead of init time, which might be the reason for why the
EnvVar
is not working properly for me. my question is, if I want to use
load_assets_from_airbyte_instance
, does that mean I cannot use
EnvVar
to configure the
AirbyteResource
? if so, what's the best way to load airbyte configuration?
os.getenv
?
thistbh 1
l
I am facing this exact same issue, can anyone from the core team confirm if EnvVar is supposed to work in this context?
t
Hi! This should be fixed next week in 1.4.4, but in the meanwhile, you can use this snippet to workaround it:
Copy code
fivetran_instance = fivetran_resource(
    build_init_resource_context(
        (
            {
                "api_key": {"env": "FIVETRAN_API_KEY"},
                "api_secret": {"env": "FIVETRAN_API_SECRET"},
            }
        )
    )
)
l
Nice one @Tim Castillo! Thanks for the response!
n
I did this for Airbyte using Dagster 1.3.14 but my config from env is still displayed in clear from the UI. Here's the code (note that I had to use the legacy
airbyte_resource
otherwise it wouldn't work) :
Copy code
airbyte_instance = airbyte_resource(
    build_init_resource_context(
        (
            {
                "host": {"env": "AIRBYTE_HOST"},
                "port": {"env": "AIRBYTE_PORT"},
                "username": {"env": "AIRBYTE_ADMIN_USER"},
                "password": {"env": "AIRBYTE_ADMIN_PASSWORD"},
            }
        )
    )
)
h
I was facing the same issue and was about to post a message, but luckily saw that thread. the community here is amazing, thanks @Tim Castillo for handling it !