Skip to content

Conversation

@dolong2
Copy link
Owner

@dolong2 dolong2 commented Oct 21, 2025

๊ฐœ์š”

  • github actions + terraform์„ ์‚ฌ์šฉํ•ด์„œ CD ํŒŒ์ดํ”„๋ผ์ธ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค.

์ž‘์—…๋‚ด์šฉ

  • provider ์ •์˜ ์ถ”๊ฐ€
  • variables ๊ด€๋ จ ์ •์˜ ์ถ”๊ฐ€
  • main.tf ๋ฐ output.tf ์ถ”๊ฐ€
  • aws ๋žŒ๋‹ค py ํŒŒ์ผ๋ฐ ์••์ถ• sh ์ถ”๊ฐ€
  • CD ๊นƒํ—ˆ๋ธŒ ์›Œํฌํ”Œ๋กœ ์ถ”๊ฐ€
  • gitignore์— ํ…Œ๋ผํผ๊ด€๋ จ ํŒŒ์ผ๋ฐ ๋””๋ ‰ํ† ๋ฆฌ ์ถ”๊ฐ€

์ฒดํฌ๋ฆฌ์ŠคํŠธ

ํƒฌํ”Œ๋ฆฟ์™ธ์— ํ•„์š”ํ•œ ํ•ญ๋ชฉ์ด ์žˆ์œผ๋ฉด ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.

  • ๋กœ์ปฌ์—์„œ ๋นŒ๋“œ๊ฐ€ ์„ฑ๊ณตํ•˜๋‚˜์š”?
  • ์ถ”๊ฐ€(์ˆ˜์ •)ํ•œ ์ฝ”๋“œ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋‚˜์š”?
  • pr ํƒ€์ผ“ ๋ธŒ๋žœ์น˜๊ฐ€ ๋งž๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ๋‚˜์š”?
  • pr์—์„œ ์ž‘์—…ํ•  ๋‚ด์šฉ๋งŒ ์ž‘์—…๋๋‚˜์š”?
  • ๊ธฐ์กด API์™€ ํ˜ธํ™˜๋˜์ง€ ์•Š๋Š” ์‚ฌํ•ญ์ด ์žˆ๋‚˜์š”?

Summary by CodeRabbit

๋ฆด๋ฆฌ์Šค ๋…ธํŠธ

  • ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ

    • GitHub Actions ๊ธฐ๋ฐ˜ ์ž๋™ ๋ฐฐํฌ ํŒŒ์ดํ”„๋ผ์ธ ์ถ”๊ฐ€
    • S3 ๋ฒ„ํ‚ท ์ด๋ฒคํŠธ ๊ฐ์ง€ ์‹œ ์ž๋™ ๋ฐฐํฌ ์‹คํ–‰ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
  • ์ธํ”„๋ผ

    • AWS Lambda, S3, IAM ๋ฆฌ์†Œ์Šค ์ž๋™ ๋ฐฐํฌ๋ฅผ ์œ„ํ•œ Terraform ์„ค์ • ์ถ”๊ฐ€
    • ๋ฐฐํฌ ํŒจํ‚ค์ง€ ๋นŒ๋“œ ์Šคํฌ๋ฆฝํŠธ ์ถ”๊ฐ€
  • ์„ค์ •

    • ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ๋ฐ AWS ๋ฆฌ์ „ ์„ค์ • ์˜ต์…˜ ์ถ”๊ฐ€
    • ๋ณด์•ˆ ์ž๊ฒฉ์ฆ๋ช… ๊ด€๋ฆฌ ์„ค์ • ์ถ”๊ฐ€

@dolong2 dolong2 self-assigned this Oct 21, 2025
@dolong2 dolong2 added 1๏ธโƒฃ Priority: ์ƒ ์šฐ์„ ์ˆœ์œ„ ์ƒ โœจ Feature ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ labels Oct 21, 2025
@dolong2 dolong2 linked an issue Oct 21, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

GitHub Actions CD ์›Œํฌํ”Œ๋กœ์šฐ, Lambda ๋ฐฐํฌ ํŒจํ‚ค์ง€ ๋นŒ๋“œ ์Šคํฌ๋ฆฝํŠธ, S3 ๋ฒ„ํ‚ท ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ Lambda ์‹คํ–‰์„ ์œ„ํ•œ Terraform ์ธํ”„๋ผ ์ฝ”๋“œ(IAM, SSM, Lambda, ์•Œ๋ฆผ ์„ค์ • ํฌํ•จ)๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

Changes

Cohort / File(s) Summary
GitHub Actions CD ์›Œํฌํ”Œ๋กœ์šฐ
.github/workflows/cd.yml
๋ฉ”์ธ ๋ธŒ๋žœ์น˜ ํ‘ธ์‹œ ์‹œ Gradle ๋นŒ๋“œ๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ  ๊ฒฐ๊ณผ๋ฌผ์„ S3 ๋ฒ„ํ‚ท์— ์—…๋กœ๋“œํ•˜๋Š” ์ž๋™ ๋ฐฐํฌ ์›Œํฌํ”Œ๋กœ์šฐ ์ถ”๊ฐ€
Git ๋ฌด์‹œ ์„ค์ •
.gitignore
/sql/ ๋””๋ ‰ํ† ๋ฆฌ ๋ฌด์‹œ ์„ค์ • ๋ณ€๊ฒฝ ๋ฐ Terraform ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ(terraform/.terraform.lock.hcl, terraform/.terraform) ๋ฌด์‹œ ํ•ญ๋ชฉ ์ถ”๊ฐ€
Terraform ์„ค์ •
terraform/provider.tf, terraform/variables.tf, terraform/random.tf
AWS ํ”„๋กœ๋ฐ”์ด๋” ์„ค์ •, 8๊ฐœ ๋ณ€์ˆ˜ ์„ ์–ธ (AWS ๋ฆฌ์ „, S3 ๋ฒ„ํ‚ท, Lambda ๋ฉ”๋ชจ๋ฆฌ/ํƒ€์ž„์•„์›ƒ, SSH ํ‚ค, ํ˜ธ์ŠคํŠธ/์‚ฌ์šฉ์ž), ๋ฒ„ํ‚ท๋ช… ์ž„์˜ ์ ‘๋ฏธ์‚ฌ ์ƒ์„ฑ
Terraform ์ธํ”„๋ผ ๋ฆฌ์†Œ์Šค
terraform/main.tf, terraform/output.tf
S3 ๋ฒ„ํ‚ท, SSM ํŒŒ๋ผ๋ฏธํ„ฐ, IAM ์—ญํ• /์ •์ฑ…, Lambda ํ•จ์ˆ˜, S3 ์ด๋ฒคํŠธ ์•Œ๋ฆผ ์„ค์ • ๋ฐ ์ถœ๋ ฅ๊ฐ’ ์ •์˜
Lambda ๋ฐฐํฌ ํŒจํ‚ค์ง€ ๋นŒ๋“œ
terraform/build_package.sh
Docker๋ฅผ ์ด์šฉํ•ด Python 3.12 Lambda ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์—์„œ ์˜์กด์„ฑ(paramiko) ์„ค์น˜ ๋ฐ lambda.zip ํŒจํ‚ค์ง€ ์ƒ์„ฑ ์Šคํฌ๋ฆฝํŠธ
Lambda ํ•ธ๋“ค๋Ÿฌ ํ•จ์ˆ˜
terraform/lambda/handler.py
S3 ์ด๋ฒคํŠธ ์ˆ˜์‹  โ†’ SSM์—์„œ SSH ํ‚ค ์กฐํšŒ โ†’ ์›๊ฒฉ ํ˜ธ์ŠคํŠธ SSH ์—ฐ๊ฒฐ โ†’ ๋ฐฐํฌ ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰(stdout/stderr ๋ฐ˜ํ™˜) ๊ธฐ๋Šฅ ๊ตฌํ˜„

Sequence Diagram(s)

sequenceDiagram
    participant S3 as S3 Bucket
    participant Lambda as Lambda Function
    participant SSM as SSM Parameter Store
    participant SSH as Remote Host
    
    S3->>Lambda: ObjectCreated:Put Event<br/>(build/* prefix)
    Lambda->>SSM: Get SSH Private Key<br/>(SSM_PARAM_NAME)
    SSM-->>Lambda: Private Key Value
    Lambda->>SSH: Connect via SSH<br/>(RSAKey, 10s timeout)
    SSH-->>Lambda: Connection Established
    Lambda->>SSH: Execute Command<br/>bash /home/{user}/deploy.sh<br/>{bucket} {key}
    SSH-->>Lambda: stdout + stderr
    Lambda-->>S3: Return Result<br/>(stdout/stderr dict)
Loading

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~25 minutes

์—ฌ๋Ÿฌ ์ด์งˆ์ ์ธ ๊ธฐ์ˆ (GitHub Actions, Bash, Terraform, Python/boto3/paramiko)์ด ํฌํ•จ๋˜์–ด ์žˆ๊ณ  AWS ์„œ๋น„์Šค ๊ฐ„ ์—ฐ๋™ ๋กœ์ง์ด ์žˆ์–ด ๊ฐ ํŒŒ์ผ๋ณ„๋กœ ๋…๋ฆฝ์ ์ธ ๊ฒ€ํ† ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋งŒ ๊ฐ ํŒŒ์ผ์˜ ๋ณ€๊ฒฝ ๋‚ด์šฉ ์ž์ฒด๋Š” ์ƒ๋Œ€์ ์œผ๋กœ ๋ช…ํ™•ํ•œ ๊ตฌ์กฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

Possibly related issues

  • CD ์ ์šฉย #728: ์ด PR์ด ์š”์ฒญ๋œ CD ํŒŒ์ดํ”„๋ผ์ธ์„ GitHub Actions ์›Œํฌํ”Œ๋กœ์šฐ ๋ฐ S3 ํŠธ๋ฆฌ๊ฑฐ Lambda ๋ฐฐํฌ๋ฅผ ํ†ตํ•ด ๊ตฌํ˜„ํ•˜๋ฏ€๋กœ ์ง์ ‘์ ์œผ๋กœ ๊ด€๋ จ๋จ

Poem

๐Ÿฐ S3 ๋ฒ„ํ‚ท์—์„œ ํ† ๋ผ ๊ท€์ฒ˜๋Ÿผ ์†Ÿ์•„์˜ค๋ฅธ Lambda,
SSH๋กœ ๋จผ ์ง‘๊นŒ์ง€ ๋ฐฐํฌ๋ฅผ ๋‚ ๋ผ์ฃผ๋„ค~
Terraform์˜ ๋งˆ๋ฒ•์œผ๋กœ ํด๋ผ์šฐ๋“œ ์„ฑ์„ ์Œ“๊ณ ,
CD ํŒŒ์ดํ”„๋ผ์ธ์ด ํ†กํ†กํ†ก ์ž๋™ํ™”๋˜๋‹ˆ,
๋ฐฐํฌ ํ† ๋ผ์˜ ๋ฒˆ๊ฐœ๊ฐ™์€ ์†๋„! โšก

โœจ Finishing touches
  • ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/cd-pipeline

๐Ÿ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 63e4887 and d67c8b0.

๐Ÿ“’ Files selected for processing (9)
  • .github/workflows/cd.yml (1 hunks)
  • .gitignore (1 hunks)
  • terraform/build_package.sh (1 hunks)
  • terraform/lambda/handler.py (1 hunks)
  • terraform/main.tf (1 hunks)
  • terraform/output.tf (1 hunks)
  • terraform/provider.tf (1 hunks)
  • terraform/random.tf (1 hunks)
  • terraform/variables.tf (1 hunks)

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 and usage tips.

@dolong2 dolong2 merged commit b322211 into develop Oct 21, 2025
1 check passed
@dolong2 dolong2 deleted the feature/cd-pipeline branch October 21, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1๏ธโƒฃ Priority: ์ƒ ์šฐ์„ ์ˆœ์œ„ ์ƒ โœจ Feature ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CD ์ ์šฉ

2 participants