awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
2.98k stars 246 forks source link

Link to amazon envvars configuration #1162

Closed Jasper-Bekkers closed 3 months ago

Jasper-Bekkers commented 3 months ago

Describe the issue

There are quite a few code samples out there, for example this one on the main page of the aws_sdk_s3 crate, that just use load_from_env() without ever documenting which env vars (or maybe I missed it but at least it wasn't clear from the get-go). Please just link to the relevant documentation, or include the relevant documentation here somewhere.

use aws_sdk_s3 as s3;

#[::tokio::main]
async fn main() -> Result<(), s3::Error> {
    let config = aws_config::load_from_env().await;
    let client = aws_sdk_s3::Client::new(&config);

    // ... make some calls with the client

    Ok(())
}

https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html

Links

https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-envvars.html https://docs.rs/aws-sdk-s3/latest/aws_sdk_s3/client/struct.Client.html

ysaito1001 commented 3 months ago

Thank you for bringing this up to our attention. The name load_from_env is historical, not necessarily referring to just environment variables; it is currently a convenience wrapper around load_defaults. That said, I agree that the rustdoc does not provide information as to what those defaults are.

We can probably link to this page.

Jasper-Bekkers commented 3 months ago

Thanks yeah I had to spend quite some time figuring out what they were, even from code its not super clear. Probably this could be a good first issue for someone to pick up also.

ysaito1001 commented 3 months ago

Will be addressed by https://github.com/smithy-lang/smithy-rs/pull/3694

ysaito1001 commented 3 months ago

The suggested link has been added to docs as of release-2024-06-18 (example)

github-actions[bot] commented 3 months ago

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.