Skip to content

Commit 61aba25

Browse files
authored
feat: Parameter Store 기반 설정 관리 전환 및 loadtest 프로필 추가 (#670)
* feat: Parameter Store 설정 전환 - secret 서브모듈 제거 및 설정 파일 분리 - 프로필별 Parameter Store import와 loadtest 프로필 추가 * feat: Parameter Store 연동 설정 추가 - Spring Cloud AWS Parameter Store 의존성 추가 - config 분리와 profile별 import/loadtest 프로필 설정 * feat: 배포 파이프라인 Parameter Store 대응 - dev/prod workflow에서 submodule checkout 제거 - compose 환경변수에 AWS_REGION 주입 * feat: S3 인증을 IAM Role 체인으로 전환 - 정적 access key/secret key 주입 제거 - DefaultCredentialsProvider 기반 S3Client 구성 * feat: 리뷰 반영 설정 보완 - local 프로필 refresh cookie-domain을 localhost로 수정 - loadtest outbound thread pool에 queue-capacity 추가 * refactor: 환경별 설정 fail-fast 정리 - websocket outbound queue-capacity 누락 보완 - prod/dev/local OAuth redirect-url fallback 제거 - yml placeholder 빈 기본값(:) 제거 - dev CORS admin 도메인 변경 반영 * chore: Parameter Store import를 fail-fast로 전환 - common/local/dev/prod/loadtest aws-parameterstore import에서 optional 제거 * refactor: cloud 설정을 SSM 단일 소스로 정리 - env placeholder(CLOUD_AWS_*) 제거 - cloud.aws.* 값은 /solid-connection/common 경로에서 주입 * refactor: DB/Flyway 설정을 프로퍼티 키 기반으로 정리 - datasource/flyway env placeholder 제거 - prod/dev baseline-on-migrate를 false로 변경 - local 빈 redis 블록 제거 * chore: 공통 변수 설정 보안/컨벤션 정리 - OAuth/JWT/Sentry/News/Loki placeholder 제거 - kakao user-info-url 키를 kebab-case로 통일 - sentry 기본 PII 비활성화 및 prod traces 샘플링 0.1 설정 - dev admin CORS origin 문자열 변경 반영 * fix: dev admin CORS origin trailing slash 제거 * feat: review comments 반영 - loadtest 프로필에 spring.flyway.enabled=false 명시 - test 설정의 kakao user-info 키를 user-info-url로 통일
1 parent a554fbc commit 61aba25

14 files changed

Lines changed: 306 additions & 25 deletions

File tree

.github/workflows/dev-cd.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
steps:
2020
- name: Checkout the code
2121
uses: actions/checkout@v4
22-
with:
23-
token: ${{ secrets.SUBMODULE_ACCESS_TOKEN }}
24-
submodules: true
2522

2623
# --- Java, Gradle 설정 ---
2724
- name: Set up JDK 17

.github/workflows/prod-cd.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ jobs:
2525
steps:
2626
- name: Checkout the code
2727
uses: actions/checkout@v4
28-
with:
29-
token: ${{ secrets.SUBMODULE_ACCESS_TOKEN }}
30-
submodules: true
3128

3229
# --- Java, Gradle 설정 ---
3330
- name: Set up JDK 17

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ dependencies {
6767
// Etc
6868
implementation platform('software.amazon.awssdk:bom:2.41.4')
6969
implementation 'software.amazon.awssdk:s3'
70+
implementation 'io.awspring.cloud:spring-cloud-aws-starter-parameter-store:3.0.4'
7071
implementation 'org.hibernate.validator:hibernate-validator'
7172
implementation 'org.springframework.boot:spring-boot-starter-websocket'
7273

docker-compose.dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
network_mode: "host"
88
environment:
99
- SPRING_PROFILES_ACTIVE=dev
10+
- AWS_REGION=ap-northeast-2
1011
- SPRING_DATA_REDIS_HOST=127.0.0.1
1112
- SPRING_DATA_REDIS_PORT=6379
1213
volumes:

docker-compose.prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
network_mode: "host"
88
environment:
99
- SPRING_PROFILES_ACTIVE=prod
10+
- AWS_REGION=ap-northeast-2
1011
- SPRING_DATA_REDIS_HOST=127.0.0.1
1112
- SPRING_DATA_REDIS_PORT=6379
1213
volumes:

src/main/java/com/example/solidconnection/s3/config/AmazonS3Config.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,21 @@
33
import org.springframework.beans.factory.annotation.Value;
44
import org.springframework.context.annotation.Bean;
55
import org.springframework.context.annotation.Configuration;
6-
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
7-
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
6+
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
87
import software.amazon.awssdk.regions.Region;
98
import software.amazon.awssdk.services.s3.S3Client;
109

1110
@Configuration
1211
public class AmazonS3Config {
1312

14-
@Value("${cloud.aws.credentials.access-key}")
15-
private String accessKey;
16-
17-
@Value("${cloud.aws.credentials.secret-key}")
18-
private String secretKey;
19-
2013
@Value("${cloud.aws.region.static}")
2114
private String region;
2215

2316
@Bean
2417
public S3Client s3Client() {
25-
AwsBasicCredentials credentials = AwsBasicCredentials.create(accessKey, secretKey);
26-
2718
return S3Client.builder()
2819
.region(Region.of(region))
29-
.credentialsProvider(StaticCredentialsProvider.create(credentials))
20+
.credentialsProvider(DefaultCredentialsProvider.create())
3021
.build();
3122
}
3223
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
spring:
2+
config:
3+
activate:
4+
on-profile: loadtest
5+
6+
jpa:
7+
show-sql: false
8+
properties:
9+
hibernate:
10+
format_sql: false
11+
12+
datasource:
13+
hikari:
14+
maximum-pool-size: 50
15+
minimum-idle: 20
16+
17+
flyway:
18+
enabled: false
19+
20+
websocket:
21+
thread-pool:
22+
inbound:
23+
core-pool-size: 24
24+
max-pool-size: 48
25+
queue-capacity: 4000
26+
outbound:
27+
core-pool-size: 24
28+
max-pool-size: 48
29+
queue-capacity: 4000
30+
heartbeat:
31+
server-interval: 10000
32+
client-interval: 10000

src/main/resources/application.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
spring:
2+
application:
3+
name: solid-connect-server
4+
25
config:
36
import:
4-
- classpath:/secret/application-cloud.yml
5-
- classpath:/secret/application-db.yml
6-
- classpath:/secret/application-variable.yml
7+
- optional:classpath:/config/application-cloud.yml
8+
- optional:classpath:/config/application-db.yml
9+
- optional:classpath:/config/application-variable.yml
10+
- aws-parameterstore:/solid-connection/common/
711

812
tomcat:
913
threads:
@@ -23,3 +27,31 @@ management:
2327
web:
2428
exposure:
2529
include: prometheus
30+
31+
---
32+
spring:
33+
config:
34+
activate:
35+
on-profile: local
36+
import: aws-parameterstore:/solid-connection/local/
37+
38+
---
39+
spring:
40+
config:
41+
activate:
42+
on-profile: dev
43+
import: aws-parameterstore:/solid-connection/dev/
44+
45+
---
46+
spring:
47+
config:
48+
activate:
49+
on-profile: prod
50+
import: aws-parameterstore:/solid-connection/prod/
51+
52+
---
53+
spring:
54+
config:
55+
activate:
56+
on-profile: loadtest
57+
import: aws-parameterstore:/solid-connection/loadtest/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
spring:
2+
config:
3+
activate:
4+
on-profile: local, dev, prod, loadtest
5+
6+
cloud:
7+
aws:
8+
stack:
9+
auto: false

0 commit comments

Comments
 (0)