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

AmazonS3Builder::from_env to populate credentials from environment #2361

Closed
tustvold opened this issue Aug 8, 2022 · 2 comments · Fixed by #2536
Closed

AmazonS3Builder::from_env to populate credentials from environment #2361

tustvold opened this issue Aug 8, 2022 · 2 comments · Fixed by #2536
Labels
enhancement Any new improvement worthy of a entry in the changelog object-store Object Store Interface

Comments

@tustvold
Copy link
Contributor

tustvold commented Aug 8, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

There are various common environment variables for configuring AWS credentials, e.g. AWS_SECRET_ACCESS_KEY, AWS_REGION, etc... We should add a from_env method that respects these

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@tustvold tustvold added the enhancement Any new improvement worthy of a entry in the changelog label Aug 8, 2022
@amrltqt
Copy link
Contributor

amrltqt commented Aug 19, 2022

I can help on this one.

Is it better to bring a full support of the builder properties through environment or just the minimum to leverage AWS_* regular environment setup?

Solution 1 we bring everything from environment but we need to introduce new variables to match each builder properties.

let object_store = AmazonS3Builder::from_env().build();

// or even ?
let object_store = AmazonS3::from_env();

Solution 2 we match existing AWS variable and provide support for AWS_* variables described there

let object_store = AmazonS3Builder::from_env()
    .with_bucket_name("the-bucket-name")
    .with_allow_http(true);

Solution 3 we support only the 4 variables used in integration test for now
(those ones: https://github.com/apache/arrow-rs/blob/master/object_store/src/aws/mod.rs#

Which one is the most suitable for you?

@tustvold
Copy link
Contributor Author

tustvold commented Aug 19, 2022

Thank you for volunteering, I think option 2 makes the most sense. Specifically where one of the builder options has a standard AWS_ environment variable, we support that.

The idea is to get people up and running quickly, much like the standard AWS SDKs, not necessarily to expose the full set of customisation supported by this crate as environment variables, nor necessarily to support the full set of configuration supported by the CLI (e.g. I don't anticipate supporting AWS_CONFIG for example).

amrltqt added a commit to amrltqt/arrow-rs that referenced this issue Aug 20, 2022
tustvold pushed a commit that referenced this issue Aug 20, 2022
* Build AmazonS3Builder from env (#2361)

* clippy: use Self instead of AmazonS3Builder

* rustdoc: remove unnecessary bare_url

* Save the current environment setup

* fmt: missing use in documentation
@alamb alamb added the object-store Object Store Interface label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog object-store Object Store Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants