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
This documentation supplements the official [AWS SDK for Kotlin Developer Guide](https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/home.html).
4
+
5
+
6
+
## Configuration
7
+
8
+
*[Endpoints](./configuring/endpoints.md) - How to configure a custom endpoint resolver
The AWS SDK for Kotlin provides the ability to provide a custom endpoint to be used for a service. In most cases
4
+
you can just use the default `EndpointResolver` provided with each service client. There are some reasons to provide
5
+
a custom endpoint though such as working with a pre-release version of a service or access to specific service
6
+
features not yet modeled in the SDK (e.g. S3 has dual-stack and FIPS endpoints).
7
+
8
+
9
+
An [Endpoint Resolver](https://github.com/awslabs/aws-sdk-kotlin/blob/main/aws-runtime/aws-endpoint/common/src/aws/sdk/kotlin/runtime/endpoint/AwsEndpointResolver.kt#L11)
10
+
can be configured to provide custom endpoint resolution logic for service clients. Every
11
+
service client config is generated with an endpoint resolver that can be overridden. The endpoint resolver is given the
12
+
service and region as a string, allowing for the resolver to dynamically drive its behavior. Each service client
13
+
package has an exported `ServiceId` constant that can be used to determine which service is invoking your endpoint
14
+
resolver.
15
+
16
+
## Examples
17
+
18
+
The following code snippet shows how a service endpoint resolver can be overridden for S3:
19
+
20
+
```kotlin
21
+
val sharedConfig =AwsClientConfig.fromEnvironment()
22
+
val client =S3Client(sharedConfig) {
23
+
endpointResolver =AwsEndpointResolver { service, region ->
0 commit comments