Skip to content

Commit

Permalink
refactor: 기존 변수 활용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
songsunkook committed Feb 6, 2025
1 parent ff44654 commit a81a331
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/in/koreatech/koin/global/config/S3Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
Expand Down Expand Up @@ -49,7 +48,8 @@ public AmazonS3 amazonS3ClientBuilder() {
return AmazonS3ClientBuilder.standard()
.withRegion(Regions.AP_NORTHEAST_2)
.withClientConfiguration(clientConfig)
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
//.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey))) // IAM user 사용
.withCredentials(new EC2ContainerCredentialsProviderWrapper()) // IAM Role 사용
.build();
}
}

0 comments on commit a81a331

Please sign in to comment.