aws-sdk-kotlin icon indicating copy to clipboard operation
aws-sdk-kotlin copied to clipboard

Make user-supplied client config available to config resolution providers

Open ianbotsf opened this issue 2 years ago • 0 comments

Describe the feature

There are several places where config resolution providers require bootstrapping values which are possibly present in user-supplied client config but those providers are unaware of and unable to access said config.

One example is region for the profile credentials provider. Profile credentials provider uses region in the case of assuming an STS web identity but it relies on the default region provider chain or an explicitly-passed region and does not reuse any supplied value in client config:

val s3 = S3Client.fromEnvironment {
    region = "us-west-2"
    credentialsProvider = ProfileCredentialsProvider() // Won't respect region on prev line
}

Another example is HTTP client engine for the ECS credentials provider. ECS credentials provider uses a client engine but it relies on the default engine or an explicitly-passed region and does not reuse any supplied value in client config:

val s3 = S3Client.fromEnvironment {
    region = "us-west-2"
    httpClientEngine = FooEngine()
    credentialsProvider = EcsCredentialsProvider(Platform) // Won't respect engine on prev line
}

Is your Feature Request related to a problem?

Some configuration values require re-specification multiple times when it should only be required once. For example, the region problem above can be solved by specifying region twice:

val s3 = S3Client.fromEnvironment {
    region = "us-west-2"
    credentialsProvider = ProfileCredentialsProvider(region = "us-west-2")
}

This is not a user-friendly pattern.

Proposed Solution

Find some way to make config resolution providers (e.g., credentials providers) aware of user-supplied client config either directly or indirectly.

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.14.2-beta

Platform (JVM/JS/Native)

n/a

Operating System and version

n/a

ianbotsf avatar Apr 13 '22 23:04 ianbotsf