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

AWS Access key is not being fetched from env variables #243

Open
nazfoxway opened this issue Jan 20, 2024 · 5 comments
Open

AWS Access key is not being fetched from env variables #243

nazfoxway opened this issue Jan 20, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@nazfoxway
Copy link

nazfoxway commented Jan 20, 2024

Describe the bug

Steps to reproduce

 vars:
  clickhouse_s3:
   bucket: xx/xx
   path: /**.parquet
   fmt: Parquet
   aws_access_key_id: "{{ env_var('AWS_ACCESS_KEY_ID') }}"
   aws_secret_access_key: "{{ env_var('AWS_SECRET_ACCESS_KEY')}}"

or select * from {{clickhouse_s3source('clickhouse_s3',aws_access_key_id='{{ env_var("AWS_ACCESS_KEY_ID") }}',aws_secret_access_key='{{ env_var("AWS_SECRET_ACCESS_KEY")}}')}}

It wont pick up env var. If provided explicitly it works.

Expected behaviour

Should work with variables

Code examples, such as models or profile settings

dbt and/or ClickHouse server logs

Configuration

Environment

  • dbt version:
  • dbt-clickhouse version:
  • clickhouse-driver version (if using native)
  • clickhouse-connect version (if using http):
  • Python version:
  • Operating system:

ClickHouse server

  • ClickHouse Server version:
  • ClickHouse Server non-default settings, if any:
  • CREATE TABLE statements for tables involved:
  • Sample data for these tables, use clickhouse-obfuscator if necessary
@nazfoxway nazfoxway added the bug Something isn't working label Jan 20, 2024
@emirkmo
Copy link

emirkmo commented Jan 27, 2024

If you don't even take a moment to provide any information about your setup, it's likely your setup that causes it as environment variable parsing is a feature of dbt core and its jinja and yaml templating.

@nazfoxway
Copy link
Author

its hard to give more context since i did everything as in documentation and its not really more than described. As an example the setup with duckdb same env variables work perfectly but Clickhouse not. All other vars are being picked up except access id and secret. If these env variables would not work, they would not work in other projects also.

@nazarigue
Copy link

FYI finally we figured out that in this macro secrets are not being passed via env variables, so we created our own s3 macro so secret would be hidden. So macro works only when access id and secret are exposed in .sql file.

@emirkmo
Copy link

emirkmo commented Mar 21, 2024

Thanks for the update, however I still don't understand what you mean as we use environment variables to fill the secrets for the macro and have done it for the past half year.

@dvic
Copy link

dvic commented Apr 16, 2024

I'm hitting the same problem, setting config like

 vars:
  clickhouse_s3:
   bucket: xx/xx
   path: /**.parquet
   fmt: Parquet
   aws_access_key_id: "{{ env_var('AWS_ACCESS_KEY_ID') }}"
   aws_secret_access_key: "{{ env_var('AWS_SECRET_ACCESS_KEY')}}"

does not work, as described above. Setting it explicitly without env_var works but only when passed directly to the macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants