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

ProfileFiles deprecation in conflict with aws_runtime docs #4019

Open
hniksic opened this issue Feb 17, 2025 · 7 comments
Open

ProfileFiles deprecation in conflict with aws_runtime docs #4019

hniksic opened this issue Feb 17, 2025 · 7 comments

Comments

@hniksic
Copy link

hniksic commented Feb 17, 2025

aws_config::profile::profile_file::ProfileFiles is deprecated with the following message:

👎Deprecated since 1.1.11: Use aws_runtime::env_config::file::EnvConfigFiles instead.

However, the aws_runtime docs state that "This crate isn’t intended to be used directly".

What is the correct course of action - should user code use the type from aws_runtime, or is there another reexport?

@aajtodd
Copy link
Contributor

aajtodd commented Feb 17, 2025

What are you trying to do? Why do you need to use these API's directly?

@hniksic
Copy link
Author

hniksic commented Feb 17, 2025

The requirement is to support custom AWS credentials in a config file. Something like:

if let Some(credentials) = &config.aws_credentials {
    let profile_files = EnvConfigFiles::builder()
        .with_file(EnvConfigFileKind::Credentials, credentials)
        .build();

    aws_cfg = aws_cfg.profile_files(profile_files);
}

@aajtodd
Copy link
Contributor

aajtodd commented Feb 17, 2025

You should be able to set AWS_SHARED_CREDENTIALS_FILE env variable (docs) as a possible alternative.

The message about "not intended to be used directly" is accurate, the intent of the crate is to support runtime functionality of the AWS SDK, not as a public API entry point. That being said we can't stop you from using it and it's a stable 1.x crate, if you need to use aws-runtime crate directly you can, just know you're off the beaten path.

@hniksic
Copy link
Author

hniksic commented Feb 17, 2025

You should be able to set AWS_SHARED_CREDENTIALS_FILE env variable

Thanks. However, the current code aims to read that setting from a config file, which is itself autogenerated and (due to our setup) preferable to using an environment variable. Is it possible to achieve that using the public API without resorting to direct use of aws-runtime?

@aajtodd
Copy link
Contributor

aajtodd commented Feb 18, 2025

No I don't believe so. Your use case is atypical and will require using APIs the SDK uses under the hood (aws-runtime).

@hniksic
Copy link
Author

hniksic commented Feb 18, 2025

Thanks for looking into it. Out of curiosity, what is the motivation for deprecating aws_config::profile::profile_file::ProfileFiles? That reexport seems like exactly what we need here.

@aajtodd
Copy link
Contributor

aajtodd commented Feb 20, 2025

Support for environment based service config it looks like: #3493

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

No branches or pull requests

2 participants