Add option to force S3 region to connect to#14398
Conversation
|
a non-fork PR needs sending since it requires secrets. Unfortunately nothing you can do for it yet @skrzypo987. |
|
Test PR with secrets: #14419 |
| @@ -920,7 +921,7 @@ private AmazonS3 createAmazonS3Client(Configuration hadoopConfig, ClientConfigur | |||
|
|
|||
There was a problem hiding this comment.
You should use the region even if endpoint isn't set
String endpoint = hadoopConfig.get(S3_ENDPOINT);
String region = hadoopConfig.get(S3_REGION);
if (endpoint != null) {
clientBuilder.setEndpointConfiguration(new EndpointConfiguration(endpoint, region));
regionOrEndpointSet = true;
}
else if (region != null) {
clientBuilder.setRegion(region);
regionOrEndpointSet = true;
}
There was a problem hiding this comment.
You are actually right. I totally ignored the fact that setting regionOrEndpointSet to true will prevent US_EAST_1 to be set as a default few lines later.
It will not effectively change anything as US_EAST_1 is always chosen as a default one, but we should set it nonetheless.
Made the change and altered tests.
ca58af8 to
2e605a3
Compare
|
If we're going to add a configuration property, we also need to document it. I'll submit a follow-up PR. cc @Praveen2112 |
Description
Pretty straightforward change allowing to force S3 client to use specified region
Non-technical explanation
Add option to force specific region when connecting to S3
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text: