File tree Expand file tree Collapse file tree
src/main/java/com/gotogether/global/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77import com .amazonaws .auth .AWSStaticCredentialsProvider ;
88import com .amazonaws .auth .BasicAWSCredentials ;
9+ import com .amazonaws .client .builder .AwsClientBuilder ;
910import com .amazonaws .services .s3 .AmazonS3 ;
1011import com .amazonaws .services .s3 .AmazonS3ClientBuilder ;
1112
@@ -20,14 +21,21 @@ public class AwsS3Config {
2021 @ Value ("${amazon.aws.region}" )
2122 private String s3RegionName ;
2223
24+ @ Value ("${amazon.aws.endpoint}" )
25+ private String s3Endpoint ;
26+
27+ @ Value ("${amazon.aws.path-style-access}" )
28+ private boolean s3PathStyleAccess ;
29+
2330 @ Bean
2431 public AmazonS3 getAmazonS3Client () {
2532 final BasicAWSCredentials basicAWSCredentials = new BasicAWSCredentials (accessKeyId , accessKeySecret );
2633
2734 return AmazonS3ClientBuilder
2835 .standard ()
2936 .withCredentials (new AWSStaticCredentialsProvider (basicAWSCredentials ))
30- .withRegion (s3RegionName )
37+ .withEndpointConfiguration (new AwsClientBuilder .EndpointConfiguration (s3Endpoint , s3RegionName ))
38+ .withPathStyleAccessEnabled (s3PathStyleAccess )
3139 .build ();
3240 }
3341}
You can’t perform that action at this time.
0 commit comments