Skip to content

Commit 71e87ff

Browse files
committed
🐛Fix: spring 4.xx과 aws v2 호환 문제로 s3Client 수동 등록
1 parent bba6c41 commit 71e87ff

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies {
5050
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
5151

5252
// AWS S3
53-
implementation "io.awspring.cloud:spring-cloud-aws-starter-s3:3.4.2"
53+
implementation "software.amazon.awssdk:s3:2.41.18"
5454

5555
// PostGIS 공간 타입 <-> JTS(Point 등) 매핑 지원
5656
implementation "org.hibernate.orm:hibernate-spatial"

src/main/java/com/be/sportizebe/global/config/S3Config.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
import lombok.Getter;
44
import org.springframework.beans.factory.annotation.Value;
5+
import org.springframework.context.annotation.Bean;
56
import org.springframework.context.annotation.Configuration;
7+
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
8+
import software.amazon.awssdk.regions.Region;
9+
import software.amazon.awssdk.services.s3.S3Client;
610

711
@Getter
812
@Configuration
@@ -16,4 +20,12 @@ public class S3Config {
1620

1721
@Value("${spring.cloud.aws.s3.path.club}")
1822
private String club;
23+
24+
@Bean
25+
S3Client s3Client() {
26+
return S3Client.builder()
27+
.region(Region.AP_NORTHEAST_2)
28+
.credentialsProvider(DefaultCredentialsProvider.create())
29+
.build();
30+
}
1931
}

0 commit comments

Comments
 (0)