Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Connectors: Use Environment Variables #9777

Closed
nickthegroot opened this issue Jul 14, 2023 · 3 comments
Closed

Data Connectors: Use Environment Variables #9777

nickthegroot opened this issue Jul 14, 2023 · 3 comments
Labels
k/enhancement New feature or improve an existing feature

Comments

@nickthegroot
Copy link
Contributor

nickthegroot commented Jul 14, 2023

Is your proposal related to a problem?

We use two different Hasura instances depending on whether we're developing locally or deploying publicly, both connected to different databases. We'd like to be able to check in and deploy the same Hasura config, only changing the environment variables depending on the environment.

Describe the solution you'd like

When defining a data connector (and it's config), allow substituting/specifying environment variables.

For example:

  • backend_configs.yaml
dataconnector:
  weaviate:
      from_env: WEAVIATE_DATABASE_GDC_URL
  • databases.yaml
- name: vectors
  ...
  configuration:
    value:
      host:
        from_env: WEAVIATE_DATABASE_URL
@nickthegroot nickthegroot added the k/enhancement New feature or improve an existing feature label Jul 14, 2023
@daniel-chambers
Copy link
Contributor

Thanks for your feedback and suggestions. 🙂

You can set your database URL using environment variables if you use configuration templating. You can specify a template property under configuration, which takes a Kriti template as a string. That template should evaluate to what you'd like your configuration.value to be, and you can draw from environment variables.

There's some brief documentation about this on the Snowflake doco page, search for the Setting the connection string as an environment variable heading.

As for the backend configs, currently you can't draw from environment variables there; thank you for the suggestion.

As a workaround, you might be able to use the HASURA_GRAPHQL_METADATA_DEFAULTS environment variable to configure your data connector agent URL on your local/prod HGE instances, instead of putting it in your YAML files. Here's an example of that env var in use.

@pavan4
Copy link

pavan4 commented Dec 27, 2023

@daniel-chambers thanks! Currently unable to add HASURA_GRAPHQL_METADATA_DEFAULTS env var on Hasura cloud - gives this error message failed with error: the HASURA_GRAPHQL_ prefix is reserved by Hasura Cloud. Any way to get around this?

I'm able to add this on my local instance and all works great!

@nickthegroot
Copy link
Contributor Author

Closing as fixed in #10077 - will go out in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants