From 6e5870d71197341a9b2a3655932de2ed24bcfb36 Mon Sep 17 00:00:00 2001 From: Luke Yan <108530647+lukeyan2023@users.noreply.github.com> Date: Thu, 31 Aug 2023 17:53:30 +0800 Subject: [PATCH] [DS-14830][dolphinscheduler-storage-s3] Allow customization of s3 regions (#14831) Replace `Regions. fromName (region). getName() ` with the `region ` variable Co-authored-by: xiangzihao <460888207@qq.com> --- .../plugin/storage/s3/S3StorageOperator.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java b/dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java index 83d367df41..86d3216aa8 100644 --- a/dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java +++ b/dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java @@ -59,7 +59,6 @@ import com.amazonaws.AmazonServiceException; import com.amazonaws.auth.AWSStaticCredentialsProvider; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.client.builder.AwsClientBuilder; -import com.amazonaws.regions.Regions; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.model.AmazonS3Exception; @@ -110,7 +109,7 @@ public class S3StorageOperator implements Closeable, StorageOperate { .standard() .withPathStyleAccessEnabled(true) .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration( - endPoint, Regions.fromName(region).getName())) + endPoint, region)) .withCredentials( new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKeyId, accessKeySecret))) .build(); @@ -119,7 +118,7 @@ public class S3StorageOperator implements Closeable, StorageOperate { .standard() .withCredentials( new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKeyId, accessKeySecret))) - .withRegion(Regions.fromName(region)) + .withRegion(region) .build(); } }