aws-sdk-kotlin
aws-sdk-kotlin copied to clipboard
Allow custom EndpointResolver to fallback
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue, please leave a comment
Describe the Feature
Allow custom endpoint resolvers to fallback to the default resolver provided with the SDK. Currently when the endpoint resolver is overridden there is no way to fallback and the custom resolver has to provide endpoints for every region/service. This makes it harder for a custom resolver to override endpoints for specific regions only.
The Go v2 SDK provides a way to fallback, e.g.:
An endpoint resolver can use the EndpointNotFoundError sentinel error value to trigger fallback resolution to the service clients default resolution logic. This allows you to selectively override one or more endpoints seamlessly without having to handle fallback logic.
Is your Feature Request related to a problem?
Proposed Solution
One possible solution is to provide a sentinel endpoint, e.g.:
endpointResolver = AwsEndpointResolver { _, region ->
if (region == "us-west-1") myCustomEndpoint else AwsEndpoint.UseDefaultReslolver
}