Skip to content

Commit b8afd71

Browse files
committed
address pr reviews
1 parent f4950d2 commit b8afd71

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

breakingChangePost.md

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,41 @@
1-
An upcoming release of the **AWS SDK for Kotlin** will introduce an optional region provider parameter that determines the AWS region when configuring a client
1+
An upcoming release of the **AWS SDK for Kotlin** will move several region-related classes into different namespaces and modules as part of an internal refactoring.
2+
This change was necessary to support adding `regionProvider` client config property, see https://github.com/awslabs/aws-sdk-kotlin/issues/1478 for more details.
23

34
# Release date
45

5-
This change will be included in the upcoming **v1.5.0** release,
6+
This change will be included in the upcoming **v1.5.0** release.
67

78
# What's changing
8-
Adding an optional `regionProvider` parameter to provide more flexibility in how regions are specified.
9-
This affects the configuration of AWS service clients.
109

11-
The SDK will resolve the region in the following priority order:
12-
1. Static region (if specified using `region = "..."`)
13-
2. Custom region provider (if specified using `regionProvider = ...`)
14-
3. Default region provider chain
10+
The `RegionProvider` and `RegionProviderChain` classes are now available from different modules than before. **This will affect your build if you're using these classes**.
1511

16-
Example usage:
17-
```kotlin
18-
val myRegionProvider = RegionProviderChain(src1, src2, src3, ...)
12+
# How to migrate
1913

20-
val s3 = S3Client.fromEnvironment {
21-
regionProvider = myRegionProvider
22-
}
23-
```
24-
If a static region is specified, the value of regionProvider will not be used:
14+
## 1. Update build dependencies
15+
If your code uses region-related classes, you may need to add a new dependency in your `build.gradle.kts`:
2516

2617
```kotlin
27-
val myRegionProvider = ...
28-
29-
val s3 = S3Client.fromEnvironment {
30-
regionProvider = myRegionProvider // Ignored since `region` is also set
31-
region = "moon-east-1"
32-
}
18+
implementation("aws.smithy.kotlin:smithy-client:<version>")
3319
```
3420

35-
# How to migrate
36-
Update your imports to reflect the new file locations:
21+
## 2. Update import statements
22+
After updating the dependencies, you'll need to modify your import statements:
23+
24+
Replace these imports:
3725

3826
```kotlin
39-
//old imports
4027
import aws.sdk.kotlin.runtime.region.RegionProvider
4128
import aws.sdk.kotlin.runtime.region.RegionProviderChain
4229
```
30+
With:
4331

4432
```kotlin
45-
//new imports
4633
import aws.smithy.kotlin.runtime.client.region.RegionProvider
4734
import aws.smithy.kotlin.runtime.client.region.RegionProviderChain
4835
```
4936

37+
No changes to your existing implementation code are required beyond updating the dependencies and imports. Your code should continue to function as before once the dependencies and imports are updated.
38+
5039
# Additional information
5140

5241
For more information about this change, see https://github.com/awslabs/aws-sdk-kotlin/issues/1478.

0 commit comments

Comments
 (0)