Skip to content

Commit

Permalink
s3 prod 프로필 활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
k-kbk committed Jan 30, 2024
1 parent 9dc39a6 commit 1a0a2ad
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/com/mjucow/eatda/common/config/S3Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package com.mjucow.eatda.common.config
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Profile
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials
import software.amazon.awssdk.regions.Region
import software.amazon.awssdk.services.s3.presigner.S3Presigner

@Configuration
@Profile("prod")
class S3Config(
@Value("\${aws.s3.credentials.access-key}")
private val accessKey: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mjucow.eatda.domain.s3.service

import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Profile
import org.springframework.stereotype.Service
import software.amazon.awssdk.services.s3.model.GetObjectRequest
import software.amazon.awssdk.services.s3.model.PutObjectRequest
Expand All @@ -11,6 +12,7 @@ import java.net.URL
import java.time.Duration

@Service
@Profile("prod")
class S3Service(
private val s3Presigner: S3Presigner,
@Value("\${aws.s3.bucket}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package com.mjucow.eatda.presentation.s3
import com.mjucow.eatda.domain.s3.dto.PresignedUrlDto
import com.mjucow.eatda.domain.s3.service.S3Service
import com.mjucow.eatda.presentation.common.ApiResponse
import org.springframework.context.annotation.Profile
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

@RequestMapping("/api/v1/s3")
@RestController
@Profile("prod")
class S3Controller(
private val s3Service: S3Service,
) : S3ApiPresentation {
Expand Down
7 changes: 0 additions & 7 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ spring:
host: localhost
port: 16379

aws:
s3:
credentials:
access-key: ${S3_ACCESS_KEY}
secret-key: ${S3_SECRET_KEY}
bucket: ${S3_BUCKET}

---

spring:
Expand Down
7 changes: 0 additions & 7 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,3 @@ spring:
port: 6379

logging.config: classpath:logback-test.xml

aws:
s3:
credentials:
access-key: ${S3_ACCESS_KEY}
secret-key: ${S3_SECRET_KEY}
bucket: ${S3_BUCKET}
18 changes: 9 additions & 9 deletions src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<Logger level="debug" name="org.jooq">
<AppenderRef ref="Console"/>
</Logger>

<appender class="ch.qos.logback.core.ConsoleAppender" name="STDOUT">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
</encoder>
</appender>

<!-- Other jOOQ related debug log output -->
<logger level="INFO" name="org.testcontainers"/>

<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>

<!-- Other jOOQ related debug log output -->
<Logger name="org.jooq" level="debug">
<AppenderRef ref="Console"/>
</Logger>

<logger name="org.testcontainers" level="INFO"/>
</configuration>

0 comments on commit 1a0a2ad

Please sign in to comment.