Skip to content

chore: AWS S3 공개 버킷 추가 - #126

Merged
SinnoLn merged 6 commits into
devfrom
chore/125-s3-public-infra
Aug 6, 2026
Merged

chore: AWS S3 공개 버킷 추가#126
SinnoLn merged 6 commits into
devfrom
chore/125-s3-public-infra

Conversation

@SinnoLn

@SinnoLn SinnoLn commented Aug 5, 2026

Copy link
Copy Markdown
Member

🔗 관련 이슈

Closes #125

📝 작업 내용

  • AWS Public S3 버킷 추가
  • 유저 IAM 권한에 S3 권한 (삭제, 조회, 업로드) 추가
  • 로컬에서 파일 업로드를 위한 MAKEFILE 명령어(파일 단위, 폴더 단위) 추가
  • infra.md 문서 업데이트

✅ 체크리스트

  • 로컬에서 빌드 및 테스트가 통과했습니다.
  • 컨벤션(브랜치/커밋 메시지)을 준수했습니다.
  • 관련 문서를 수정했습니다. (필요한 경우)

💬 리뷰 참고 사항

Cloudflare Cloud Connector로 서빙 도메인(assets.chaeso-zip.com)을 연결했습니다.
로컬환경에서 S3 파일 업로드시 MAKEFILE 을 참고하여 업로드 가능합니다.
관련 기능이 없는 관계로 앱 인스턴스에는 S3 버킷 쓰기 권한을 주지 않았습니다.
서버 인스턴스 30GB도 같이 명시했습니다

Summary by CodeRabbit

  • 새 기능

    • 공개 정적 자산을 단일 파일 또는 폴더 단위로 업로드하고 동기화할 수 있습니다.
    • 업로드 완료 후 CDN 및 원본 접근 URL을 확인할 수 있습니다.
    • 공개 자산 저장소와 보안 접근 제어가 추가되었습니다.
  • 문서

    • 공개 자산 저장소의 용도, 경로 규칙, 제공 도메인 및 업로드 방법을 문서화했습니다.
  • 개선

    • 자산 업로드 과정에서 잘못된 파일 지정이나 설정을 사전에 확인합니다.
    • 정적 자산 제공을 위한 저장 공간과 접근 구성이 개선되었습니다.

@SinnoLn SinnoLn self-assigned this Aug 5, 2026
@SinnoLn SinnoLn added the chore label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SinnoLn, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 834f46f6-31ed-4331-8875-d7a409dfe701

📥 Commits

Reviewing files that changed from the base of the PR and between ee6d107 and 474bd4b.

📒 Files selected for processing (2)
  • Makefile
  • infra/modules/aws/app/s3-ad-history.tf
📝 Walkthrough

Walkthrough

공개 정적 자산용 S3 버킷과 접근 정책을 추가했습니다. Terraform이 버킷 이름을 출력합니다. Makefile이 파일 또는 디렉터리를 업로드합니다. 인프라 문서가 키 prefix와 URL을 설명합니다. EC2 루트 볼륨은 30GB gp3로 설정했습니다.

Changes

공개 정적 자산

Layer / File(s) Summary
공개 S3 저장소와 접근 제어
infra/modules/aws/app/s3-public.tf, infra/modules/aws/app/outputs.tf, infra/environments/aws/prod/main.tf, infra/environments/aws/prod/team-access.tf
공개 S3 버킷, 액세스 로그, 퍼블릭 읽기 정책, HTTPS 전용 정책을 추가했습니다. 팀원에게 버킷 목록 조회와 객체 생성·조회·삭제 권한을 부여했습니다. Terraform이 버킷 이름을 출력합니다.
자산 업로드 명령과 문서
Makefile, docs/infra.md
upload-assetupload-assets를 추가했습니다. 입력 검증 후 S3 업로드 또는 prefix 동기화를 수행하고 CDN 및 원본 URL을 출력합니다. 도움말과 인프라 문서에 사용법과 channels/, users/ prefix를 기록했습니다.

EC2 루트 볼륨

Layer / File(s) Summary
EC2 루트 볼륨 설정
infra/modules/aws/app/main.tf
루트 볼륨을 암호화된 30GB gp3로 명시했습니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Makefile
  participant Terraform
  participant S3Bucket
  Developer->>Makefile: upload-asset 또는 upload-assets 실행
  Makefile->>Terraform: public_bucket_name 조회
  Terraform-->>Makefile: S3 버킷 이름 반환
  Makefile->>S3Bucket: 파일 업로드 또는 prefix 동기화
  S3Bucket-->>Makefile: 업로드 완료
  Makefile-->>Developer: CDN 및 원본 URL 출력
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning EC2 루트 볼륨을 30GB gp3로 변경하고 테스트 설정의 리전을 제거한 변경은 이슈 #125의 범위를 벗어납니다. 루트 볼륨 변경과 테스트 설정 변경을 별도 PR로 분리하거나, 이슈 #125에서 해당 변경의 필요성을 명시하세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 공개 S3 인프라, 관련 문서, 업로드 Makefile 명령어를 추가하여 이슈 #125의 코딩 요구사항을 충족합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 AWS 공개 S3 버킷 추가라는 변경의 핵심 내용을 정확하고 간결하게 설명합니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/125-s3-public-infra

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SinnoLn SinnoLn linked an issue Aug 5, 2026 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 126: Update the uploads around the Makefile commands at Makefile lines
126-126 and 134-134 to remove the one-year cache lifetime for mutable
channels/<channel-id>.png and users/<user-id>.png keys, applying the same
short-TTL cache policy used for single-file uploads at both sites.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f955a2c4-d3f5-41bd-a5c7-c5576b5885cf

📥 Commits

Reviewing files that changed from the base of the PR and between 7681df0 and ee6d107.

📒 Files selected for processing (8)
  • Makefile
  • docs/infra.md
  • infra/environments/aws/prod/main.tf
  • infra/environments/aws/prod/team-access.tf
  • infra/modules/aws/app/main.tf
  • infra/modules/aws/app/outputs.tf
  • infra/modules/aws/app/s3-public.tf
  • src/test/resources/application.yaml
💤 Files with no reviewable changes (1)
  • src/test/resources/application.yaml

Comment thread Makefile Outdated
Comment thread infra/modules/aws/app/s3-public.tf
Comment thread infra/modules/aws/app/main.tf
@claude

claude Bot commented Aug 5, 2026

Copy link
Copy Markdown

코드 리뷰 결과 (자동)

이 PR은 인프라(Terraform) 변경 중심으로, 공개 정적 자산용 S3 버킷 추가 및 관련 IAM/Makefile/문서 변경입니다. must-fix 관점에서 검토한 결과는 아래와 같습니다.

🟠 Major

  • infra/modules/aws/app/s3-public.tf:5-9 — 신규 public 버킷에 대해 aws_s3_bucket_logging을 설정했지만, 로그 타겟인 s3_access_logs 버킷의 정책(infra/modules/aws/app/s3-ad-history.tf:41-56)이 aws:SourceArn 조건을 ad_history 버킷 ARN으로만 제한하고 있어 public 버킷의 로그 전달이 조용히 거부됩니다. terraform apply는 성공하지만 실제 로그는 쌓이지 않습니다. 해당 정책의 ArnLike 조건에 aws_s3_bucket.public.arn을 추가해야 합니다. (인라인 코멘트 참고)

🟡 Minor

  • infra/modules/aws/app/main.tf:124-128 — PR 목적(S3 공개 버킷)과 무관한 프로덕션 EC2 루트 볼륨 변경(volume_size = 30, volume_type = "gp3")이 설명 없이 포함되어 있습니다. 파괴적인 변경은 아니지만 PR 설명에 이유를 추가하거나 별도 PR로 분리를 권장합니다. (인라인 코멘트 참고)

나머지 변경(퍼블릭 버킷 정책의 PublicReadGetObject + DenyInsecureTransport 구성, teammate IAM 정책 범위, Makefile 업로드 타겟, public_bucket_name output 배선)은 기존 s3-ad-history.tf 컨벤션과 일관되며 의도(공개 읽기 전용, 쓰기는 IAM 제한)에 부합합니다.

@SinnoLn
SinnoLn requested a review from 1117mg August 5, 2026 07:48

@1117mg 1117mg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@SinnoLn
SinnoLn merged commit 6d68c8b into dev Aug 6, 2026
3 checks passed
@SinnoLn
SinnoLn deleted the chore/125-s3-public-infra branch August 6, 2026 03:24
SinnoLn added a commit that referenced this pull request Aug 8, 2026
* chore: AWS S3 공개 버킷 추가 (#126)

* feat(infra): add public S3 bucket and upload commands for static assets

* docs: document public static assets S3 bucket

* chore: remove unused region field from onboarding S3 test config

* chore(infra): increase EC2 root volume to 30GB and switch to gp3

* fix: address review feedback on public assets bucket

* fix(infra): scope down public bucket permissions and fix access log delivery

* feat: 저장된 시뮬레이션 목록 및 상세 조회 API 구현 (#130)

* fix(simulation): mark optional response fields NOT_REQUIRED instead of nullable

* feat(simulation): add saved simulation detail API

* feat(simulation): add paginated my-simulations list API

* chore(simulation): drop unused SimulationNotFoundException import

* fix(simulation): omit null fields from simulation item responses

* fix(simulation): count only funded channels in list summaries

* docs(simulation): add a page/size example to the list API 400 response

* feat: 채널 추천 결과 저장 API 구현 (#133)

* fix(security): scope the public recommendations path to GET

* fix(openapi): publish data and error as required on response wrappers

* feat(recommendation): add channel recommendation save API

* fix(recommendation): serialize saves per onboarding

* feat: add flyway migration v16

* feat(channel): filter the channel list by primary category (#134)

* feat: 온보딩 나이대 응답에 "잘 모르겠어요"(UNDECIDED) 추가 (#138)

* feat(infra): disable aws scheduler

* refactor(performance): build AdPerformance via Lombok builder instead of positional constructor

* feat(onboarding): let users answer "don't know" for target age band

* refactor(onboarding): extract OnboardingNotFoundException for id-based lookups

* test(onboarding): cover UNDECIDED-alone and AdPerformance ratio branches

---------

Co-authored-by: Yelim Lee <142207312+1117mg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE] S3 Public 인프라 추가

2 participants