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

Allow loading config files only once per-client #821

Open
1 task done
ianbotsf opened this issue Jan 26, 2023 · 0 comments
Open
1 task done

Allow loading config files only once per-client #821

ianbotsf opened this issue Jan 26, 2023 · 0 comments
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue queued This issues is on the AWS team's backlog

Comments

@ianbotsf
Copy link
Contributor

Describe the feature

Shared config files (e.g., ~/.aws/config and ~/.aws/credentials) may be used by the SDK to determine credentials for service clients via ProfileCredentialsProvider. As written, the provider will read the config on every request for credentials—potentially on every API request. (In the default configuration for SDK clients, this will be read as part of the default credentials chain, which caches credentials for 15 minutes.)

This may be desirable under some circumstances but other use cases may require reading the config files only once and reusing those values for the duration of the client. Consider adding a mechanism (e.g., a parameter to the provider) which controls whether files are parsed on demand (current behavior) or only once.

Is your Feature Request related to a problem?

n/a

Proposed Solution

One potential solution is a parameter to the provider that allows configuring when and how often config files are read. For example:

val currentBehavior = ProfileCredentialsProvider()

val loadOnlyOnce = ProfileCredentialsProvider(loadBehavior = ProfileLoadBehavior.LoadOnInitialization)

Options to consider for loading behavior are:

  • load on every request (current behavior)
  • load once on provider initialization (greedy)
  • load once on first request (lazy)

Describe alternative solutions or features you've considered

No response

Acknowledge

  • I may be able to implement this feature request

AWS Kotlin SDK version used

0.19.5-beta

Platform (JVM/JS/Native)

JVM

Operating System and version

Amazon Linux 2

@ianbotsf ianbotsf added the feature-request A feature should be added or improved. label Jan 26, 2023
@RanVaknin RanVaknin added p3 This is a minor priority issue queued This issues is on the AWS team's backlog labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

No branches or pull requests

2 participants