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

Add support for setting the region + update duckdb #8

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

samansmink
Copy link
Collaborator

This PR adds support for also setting the s3 region automatically. Additionally, it updates the submodule.

With this PR default behaviour of the load_aws_credentials() call now also uses the aws sdk to fetch the region either from the config file or the AWS_DEFAULT_REGION env variable.

Also wanted to fetch the endpoint which the aws cli can now parse from the config file or env var, but that appears to be not yet supported: aws/aws-sdk-cpp#2587

With this PR, you are able to set up multiple profiles with different credentials and regions in your ~/.aws/config and easily switch between them.

@samansmink samansmink requested a review from Tishj August 31, 2023 17:13
@stephaniewang526
Copy link
Contributor

Thanks for the fix! A general question regarding where credentials are extracted.. I assume this continues to work for creds saved in ~/.aws/credentials, right? And those will take precedence over creds saved in ~/.aws/config? Does this extract tokens also from ~/.aws/cli/cache (for shared profiles and temporary credentials) -- does cache take precedence over /credentials?

@carlopi Could you advise whether this works in duckdb-wasm? A desirable workflow is user loads the AWS extension in browser, calls load_credentials tf, and boom it just works when they read S3 files.

@carlopi
Copy link
Contributor

carlopi commented Aug 31, 2023

@carlopi Could you advise whether this works in duckdb-wasm? A desirable workflow is user loads the AWS extension in browser, calls load_credentials tf, and boom it just works when they read S3 files.

@stephaniewang526: This will not work as is in duckdb-wasm, and a replacement behaviour might be desirable where a call to load_aws_credentials becomes an hook for some other sort of alternative behaviour in duckdb-wasm

@stephaniewang526
Copy link
Contributor

@carlopi Could you advise whether this works in duckdb-wasm? A desirable workflow is user loads the AWS extension in browser, calls load_credentials tf, and boom it just works when they read S3 files.

@stephaniewang526: This will not work as is in duckdb-wasm, and a replacement behaviour might be desirable where a call to load_aws_credentials becomes an hook for some other sort of alternative behaviour in duckdb-wasm

Thank you for the information. To double-check, if the user provides their credentials through the SET commands in browser (which sets them in DBConfig) then that should be available through select * from duckdb_settings() right?

@carlopi
Copy link
Contributor

carlopi commented Aug 31, 2023

To double-check, if the user provides their credentials through the SET commands in browser (which sets them in DBConfig) then that should be available through select * from duckdb_settings() right?

On that should behave the same as duckdb CLI.

Copy link

@Tishj Tishj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants