You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a StaticRegionProvider class to explicitly set a region to use.
Is your Feature Request related to a problem?
Currently Kotlin SDK does not have a mechanism to explicitly set the region via a RegionProvider; this is useful for say development environments (outside of AWS) where the region can't be directly inferred and configuration is integrated with other application configuration (i.e. no using system properties or environment variables)
Proposed Solution
public class StaticRegionProvider(private val region: String) : RegionProvider {
override suspend fun getRegion(): String = region
}
Describe alternative solutions or features you've considered
See proposed solution.
Acknowledge
I may be able to implement this feature request
AWS Kotlin SDK version used
029.0-beta
Platform (JVM/JS/Native)
JVM
Operating System and version
MacOS
The text was updated successfully, but these errors were encountered:
Is this just a "nice to have" request or is this blocking something for you?
As far as I understand the request you can get this now by wrapping client creation in a way that you consult your own region provider and pass that to client construction.
e.g.
val resolvedRegion = regionProvider.getRegion()
val s3 =S3Client.fromEnvironment{
region = resolvedRegion
}
Not blocking anything atm, have done as noted above, creating our own StaticRegionProvider driven by configuration.
Q: what are RegionProviders used for in Kotlin SDK? They aren't symmetrical with CredentialsProvider behaviour (provider set at construction time, queried for each API call). Kotlin SDK clients look to use a stringly-typed region parameter at construction time.
Q: what are RegionProviders used for in Kotlin SDK? They aren't symmetrical with CredentialsProvider behaviour (provider set at construction time, queried for each API call). Kotlin SDK clients look to use a stringly-typed region parameter at construction time.
They're used in fromEnvironment when we need to try and auto detect the region that the client should be configured for. Unlike credentials, region is static once set and doesn't change through the lifetime of a client (e.g. region doesn't expire, your EC2 instance isn't going to magically be in a different region, etc). If you need to talk to a different region you would create a new client or use the withConfig extension (see developer guide here).
Describe the feature
Create a
StaticRegionProvider
class to explicitly set a region to use.Is your Feature Request related to a problem?
Currently Kotlin SDK does not have a mechanism to explicitly set the region via a RegionProvider; this is useful for say development environments (outside of AWS) where the region can't be directly inferred and configuration is integrated with other application configuration (i.e. no using system properties or environment variables)
Proposed Solution
Describe alternative solutions or features you've considered
See proposed solution.
Acknowledge
AWS Kotlin SDK version used
029.0-beta
Platform (JVM/JS/Native)
JVM
Operating System and version
MacOS
The text was updated successfully, but these errors were encountered: