Skip to content

Commit

Permalink
Check for China region whenn determining the AWS URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ema committed Nov 22, 2024
1 parent 3c85815 commit ac242c0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,15 @@ object CloudStorageOperations {
s3ClientBuilder.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(stageEndPoint.get, regionName.get))
} else if (useRegionUrl.get.toBoolean) {
val awsDomain: String =
if (regionName.get.toLowerCase().startsWith("cn-")) {
".amazonaws.cn"
} else {
".amazonaws.com"
}
s3ClientBuilder.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(
"s3." + regionName.get + ".amazonaws.com", regionName.get))
"s3." + regionName.get + awsDomain, regionName.get))
} else {
s3ClientBuilder.withRegion(regionName.get)
}
Expand Down

0 comments on commit ac242c0

Please sign in to comment.