From c3082935e71f628f251355d261917e09305ebcf3 Mon Sep 17 00:00:00 2001 From: mjttong Date: Tue, 27 Aug 2024 14:04:45 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20credetial=EC=9D=84=20IAM=20role=EC=9D=84?= =?UTF-8?q?=20=ED=86=B5=ED=95=B4=20=EB=B6=80=EC=97=AC=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=B3=80=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file_share/global/config/S3Config.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/main/java/acc/hotsix/file_share/global/config/S3Config.java b/src/main/java/acc/hotsix/file_share/global/config/S3Config.java index 08111e4..463f00b 100644 --- a/src/main/java/acc/hotsix/file_share/global/config/S3Config.java +++ b/src/main/java/acc/hotsix/file_share/global/config/S3Config.java @@ -3,39 +3,20 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentials; -import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; -import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.presigner.S3Presigner; @Configuration public class S3Config { - - @Value("${cloud.aws.credentials.access-key}") - private String accessKey; - - @Value("${cloud.aws.credentials.secret-key}") - private String secretKey; - @Value("${cloud.aws.region.static}") private String region; - // access, secret key 이용해 aws 자격증명 제공 - @Bean - public AwsCredentialsProvider awsCredentialsProvider() { - AwsCredentials awsCredentials = AwsBasicCredentials.create(accessKey, secretKey); - return StaticCredentialsProvider.create(awsCredentials); - } - // s3서비스를 이용하기 위한 S3Client 객체 생성 @Bean public S3Client s3Client() { return S3Client.builder() .region(Region.of(region)) - .credentialsProvider(awsCredentialsProvider()) .build(); } @@ -44,7 +25,6 @@ public S3Client s3Client() { public S3Presigner s3Presigner() { return S3Presigner.builder() .region(Region.of(region)) - .credentialsProvider(awsCredentialsProvider()) .build(); } }