You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/06 02:07:31 UTC

[GitHub] [dolphinscheduler] 8431 commented on issue #11627: [Bug] [dolphinscheduler-common] When an application is deployed on the EC2 machine on AWS and S3 is operated, it will be rejected

8431 commented on issue #11627:
URL: https://github.com/apache/dolphinscheduler/issues/11627#issuecomment-1237581959

   private S3Utils() {
           if (PropertyUtils.getString(RESOURCE_STORAGE_TYPE).equals(STORAGE_S3)) {
               AWSCredentialsProvider provider = new AWSCredentialsProviderChain(
                       new EC2ContainerCredentialsProviderWrapper(),
                       new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY_ID, SECRET_KEY_ID)));
               if (!StringUtils.isEmpty(PropertyUtils.getString(AWS_END_POINT))) {
                   s3Client = AmazonS3ClientBuilder
                           .standard()
                           .withPathStyleAccessEnabled(true)
                           .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(PropertyUtils.getString(AWS_END_POINT), Regions.fromName(REGION).getName()))
                           .withCredentials(provider)
                           .build();
               } else {
                   s3Client = AmazonS3ClientBuilder
                           .standard()
                           .withCredentials(provider)
                           .withRegion(Regions.fromName(REGION))
                           .build();
               }
               checkBucketNameIfNotPresent(BUCKET_NAME);
           }
       }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org