Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e4fbfa2
Add terraform project files
2ghrms Aug 24, 2025
8ac9e55
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜
2ghrms Aug 26, 2025
dd8165c
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - README.md ์ˆ˜์ •
2ghrms Aug 26, 2025
af1ac30
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - gitignore ์ˆ˜์ •
2ghrms Aug 26, 2025
6e6be90
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - bootstrap ๊ด€๋ จ ์ˆ˜์ •
2ghrms Aug 26, 2025
fc20dad
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - gitignore ์ˆ˜์ •
2ghrms Aug 26, 2025
acf6234
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - gitignore ์ˆ˜์ •
2ghrms Aug 26, 2025
7834138
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - tag ํ†ต์ผ ๋ฐ ์ถ”๊ฐ€ ์—ด์–ด๋‘ 
2ghrms Aug 26, 2025
f99df6d
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - ์ฃผ์„ ์ œ์™ธ
2ghrms Aug 28, 2025
8a012d4
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - EC2 ๊ฐœํŽธ
2ghrms Aug 28, 2025
fc0ec51
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - EC2 ๊ฐœํŽธ
2ghrms Aug 28, 2025
e02a937
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - RDS ๊ฐœํŽธ
2ghrms Aug 28, 2025
741ecd5
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - description ์ถ”๊ฐ€
2ghrms Aug 28, 2025
e94deaa
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - ๋ชจ๋“  variables ์‚ฌ์šฉํ•˜๋„๋ก ๋ชจ๋“ˆ ์ˆ˜์ •
2ghrms Aug 28, 2025
aff462d
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - env์—์„œ vars๋กœ ๋นผ์ง€ ์•Š๊ณ  locals.tf๋กœ ์ ์šฉํ•˜๋„๋ก ์ˆ˜์ •
2ghrms Aug 28, 2025
682cd3c
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - env์—์„œ vars๋กœ ๋นผ์ง€ ์•Š๊ณ  locals.tf๋กœ ์ ์šฉํ•˜๋„๋ก ์ˆ˜์ •
2ghrms Aug 28, 2025
dfded97
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - env์˜ outputs.tf ์‚ญ์ œ
2ghrms Aug 28, 2025
f445680
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - ํƒœ๊ทธ ๋ฐ ์ด๋ฆ„ ์ˆ˜์ •
2ghrms Aug 28, 2025
dec7745
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - locals.tf ์ˆ˜์ •
2ghrms Aug 28, 2025
0a2abf5
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - EC2์™€ RDS ํ™˜๊ฒฝ ๋ถ„๋ฆฌ
2ghrms Aug 28, 2025
20f8aa8
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - fomat ๊ฒ€์‚ฌ
2ghrms Aug 28, 2025
9a0f694
feat/init: PR ์ฝ”๋ฉ˜ํŠธ ๋ฐ˜์˜ - cicd vars ์ถ”๊ฐ€
2ghrms Aug 28, 2025
f2f3559
feat/init: domain dev, prod ๋ถ„๊ธฐ
2ghrms Aug 28, 2025
d6c5209
feature/init: ACM๊ณผ ALB ๋ชจ๋“ˆ ์ถ”๊ฐ€ ๋ฐ CI ์ตœ์ ํ™”
2ghrms Sep 10, 2025
f038ab3
Merge remote-tracking branch 'origin/feature/init'
2ghrms Sep 10, 2025
bd6886a
feat/init: ci ์ˆ˜์ •
2ghrms Sep 12, 2025
19d30de
fix: Terraform CI ์˜ค๋ฅ˜ ๋ฐ Route53 count ์˜์กด์„ฑ ๋ฌธ์ œ ํ•ด๊ฒฐ
2ghrms Sep 12, 2025
7bbbbe4
fix: Route53 ๋ชจ๋“ˆ record_name ๋ณ€์ˆ˜ ํ•„์ˆ˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ
2ghrms Sep 12, 2025
fa805c1
fix: Route53 record_name null ์ฒดํฌ ์ถ”๊ฐ€
2ghrms Sep 12, 2025
27606d3
fix: Route53 count ์˜์กด์„ฑ ๋ฌธ์ œ ํ•ด๊ฒฐ
2ghrms Sep 12, 2025
b79f689
feature/init: PR ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜ํ•œ ๊ฐœ์„ ์‚ฌํ•ญ
2ghrms Sep 18, 2025
c22c3bc
feat/init: CI ํŒŒ์ดํ”„๋ผ์ธ์—์„œ RDS ์ž๊ฒฉ์ฆ๋ช… ํ†ตํ•ฉ
2ghrms Sep 21, 2025
a38682c
feat/init: db storage 30์œผ๋กœ ์ฆ๊ฐ€
2ghrms Sep 21, 2025
773fe6b
feat/init: route53 ์„ค์ • ํ†ต์ผ -> hosted zone ์ƒ์„ฑ
2ghrms Sep 21, 2025
2988595
feat/init: userdata.sh ์ˆ˜์ •
2ghrms Sep 21, 2025
afb812d
feat/init: too many comands line ํ•ด๊ฒฐ ์œ„ํ•ด secrets๋ฅผ terraform.tfvars๋กœ ์ฒ˜๋ฆฌ
2ghrms Sep 21, 2025
8c73fc4
feat/init: ๋ฒ„ํ‚ท ํ†ต์ผ
2ghrms Sep 21, 2025
e6bb3b3
feat/init: S3 ๋ฐฑ์—”๋“œ ์ ์šฉ
2ghrms Sep 21, 2025
4b9ead8
feat/init: CI์—์„œ userdata ์‚ฌ์šฉํ•˜์ง€ ์•Š๋„๋ก ์ˆ˜์ •
2ghrms Sep 21, 2025
f6adb21
feat/init: CD ์กฐ๊ฑด ๋ณ€๊ฒฝ (์ดํ›„์— ๋กค๋ฐฑ ์˜ˆ์ •)
2ghrms Sep 21, 2025
8e69431
feat/init: userdata.sh ํŒŒ์ผ ์ฝ๋„๋ก ์ˆ˜์ •
2ghrms Sep 21, 2025
5506247
feat/init: cd ์—๋Ÿฌ ํ•ด๊ฒฐ
2ghrms Sep 21, 2025
318f156
feature/init: Terraform apply ์˜ค๋ฅ˜๋“ค ํ•ด๊ฒฐ
2ghrms Sep 23, 2025
881c8af
feature/init: ci fmt๋ฌธ์ œ ํ•ด๊ฒฐ
2ghrms Sep 23, 2025
22bfe45
feature/init: cd fmt๋ฌธ์ œ ํ•ด๊ฒฐ
2ghrms Sep 23, 2025
1972bdc
feat/init: nginx ํฌํ•จ userdata.sh ์ ์šฉ
2ghrms Oct 2, 2025
61de54e
feature/init: fmt ์—๋Ÿฌ ํ•ด๊ฒฐ
2ghrms Oct 2, 2025
436ff42
feat/init: rds password ์ถ”๊ฐ€
2ghrms Oct 13, 2025
61790be
feat/init: vpc environment ์ถ”๊ฐ€
2ghrms Oct 13, 2025
5398b63
feat/init: rds password ์ถ”๊ฐ€
2ghrms Oct 13, 2025
f9151bb
feat/init: ์˜๋„ํ•œ ์ด๋ฆ„์ด ๋ณด์ด๋„๋ก ์ˆ˜์ •
2ghrms Oct 13, 2025
9dd0264
feat/init: userdata base64 ์ธ์ฝ”๋”ฉ
2ghrms Oct 13, 2025
5ebd7d7
feat/init: rds์™€ s3 ์ด๋ฆ„ ๋ณ€๊ฒฝ
2ghrms Oct 13, 2025
8af2149
feat/init: s3 ๋ฒ„ํ‚ท๋ช… ์ถฉ๋Œ๋กœ ์ด๋ฆ„ ์ˆ˜์ •
2ghrms Oct 13, 2025
56f39de
feat/init: rds ์ดˆ๊ธฐํ™”
2ghrms Oct 13, 2025
c81e0fe
feat/init: rds ์ดˆ๊ธฐํ™” ๋กค๋ฐฑ
2ghrms Oct 13, 2025
2debc48
feat/init: mysql ์„ค์น˜ ์ถ”๊ฐ€ ๋ฐ userdata.sh ๊ฒฝ๋กœ ์ˆ˜์ •
2ghrms Oct 13, 2025
6d67af4
feat/init: cicd์—์„œ userdata.sh ์ œ์™ธ
2ghrms Oct 13, 2025
703d5ff
feat/init: userdata.sh base64 encoding
2ghrms Oct 13, 2025
8cf3f57
feat/init: userdata.sh local.tf encoding
2ghrms Oct 13, 2025
5ea4c1e
feat/init: cd rollback, not replace ec2 on change userdata
2ghrms Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/โ™ป๏ธ-refactor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: "โ™ป๏ธ refactor"
about: ๋ฆฌํŒฉํ† ๋ง ์ด์Šˆ ํ…œํ”Œ๋ฆฟ
title: "[refactor] "
labels: "โ™ป๏ธ refactor"
assignees: ''

---

## ๐Ÿ“Œ Description
-
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/โœจ-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: "โœจ feature"
about: ๊ธฐ๋Šฅ ์ถ”๊ฐ€ ์ด์Šˆ ํ…œํ”Œ๋ฆฟ
title: "[feat] "
labels: "โœจ feature"
assignees: ''

---

## ๐Ÿ“Œ Description
-
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/๐Ÿ›-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: "\U0001F41B fix"
about: ๋ฒ„๊ทธ ๋ฐ ์—๋Ÿฌ ์ด์Šˆ ํ…œํ”Œ๋ฆฟ
title: "[fix] "
labels: "\U0001F41B fix"
assignees: ''

---

## ๐Ÿ“Œ Description
-
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/๐Ÿ“-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: "\U0001F4DD documentation"
about: ๋ฌธ์„œํ™” ์ด์Šˆ ํ…œํ”Œ๋ฆฟ
title: "[docs] "
labels: "\U0001F4DD documentation"
assignees: ''

---

## ๐Ÿ“Œ Description
-
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- ์ œ๋ชฉ ๊ทœ์น™ -->
<!-- [Type/{#์ด์Šˆ๋ฒˆํ˜ธ}] ์ž‘์—…๋‚ด์šฉ -->
<!-- ์˜ˆ์‹œ: [Feat/#20] ์นด์นด์˜ค ์†Œ์…œ ๋กœ๊ทธ์ธ ๊ตฌํ˜„ -->

<!-- ๋ฆฌ๋ทฐ์–ด์™€ ๋ผ๋ฒจ์„ ๊ผญ ์ ์šฉํ•ด ์ฃผ์„ธ์š”!-->

## ๐Ÿ“Œ ์—ฐ๊ด€ ์ด์Šˆ
<!-- ์ด PR๊ณผ ์—ฐ๊ด€๋œ ์ด์Šˆ ๋ฒˆํ˜ธ๋ฅผ ์ ์–ด์ฃผ์„ธ์š” -->
- close #

## ๐ŸŒฑ PR ์š”์•ฝ
<!-- ์ด PR์—์„œ ์ž‘์—…ํ•œ ๋‚ด์šฉ์„ ๊ฐ„๋‹จํžˆ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š” -->

## ๐Ÿ›  ์ž‘์—… ๋‚ด์šฉ
<!-- ๊ตฌ์ฒด์ ์ธ ์ž‘์—… ๋‚ด์šฉ์„ ์ ์–ด์ฃผ์„ธ์š” -->
-
-

## ๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท
<!-- ์ž‘์—…ํ•œ ํ™”๋ฉด์˜ ์Šคํฌ๋ฆฐ์ƒท์„ ์ฒจ๋ถ€ํ•ด์ฃผ์„ธ์š” -->

## โ—๏ธ๋ฆฌ๋ทฐ์–ด๋“ค๊ป˜
<!-- ๋ฆฌ๋ทฐ์–ด๊ฐ€ ํŠน๋ณ„ํžˆ ๋ด์•ผํ•  ๋ถ€๋ถ„์ด๋‚˜ ์ฃผ์˜ํ•  ์ ์„ ์ ์–ด์ฃผ์„ธ์š” -->
134 changes: 134 additions & 0 deletions .github/workflows/README_DESTROY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Terraform Destroy Workflows

์ด ๋””๋ ‰ํ† ๋ฆฌ๋Š” AWS ์ธํ”„๋ผ๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ ์‚ญ์ œํ•˜๊ธฐ ์œ„ํ•œ GitHub Actions ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.

## ๐Ÿšจ ์ฃผ์˜์‚ฌํ•ญ

- **์ด ์›Œํฌํ”Œ๋กœ์šฐ๋“ค์€ ๋˜๋Œ๋ฆด ์ˆ˜ ์—†๋Š” ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค**
- **Production ํ™˜๊ฒฝ ์‚ญ์ œ ์ „์—๋Š” ๋ฐ˜๋“œ์‹œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฑ์—…์„ ์™„๋ฃŒํ•˜์„ธ์š”**
- **์‹คํ–‰ ์ „์— ๋ชจ๋“  ์ค‘์š”ํ•œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐฑ์—…๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”**

## ๐Ÿ“‹ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์›Œํฌํ”Œ๋กœ์šฐ

### 1. Development ํ™˜๊ฒฝ ์‚ญ์ œ (`destroy_dev.yml`)

**์‚ฌ์šฉ ์‹œ๋‚˜๋ฆฌ์˜ค:**
- ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์—์„œ ํ…Œ์ŠคํŠธ ํ›„ ์ธํ”„๋ผ ์ •๋ฆฌ
- ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์žฌ๊ตฌ์„ฑ
- ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๋น„์šฉ ์ ˆ์•ฝ

**์‹คํ–‰ ๋ฐฉ๋ฒ•:**
1. GitHub ์ €์žฅ์†Œ์˜ Actions ํƒญ์œผ๋กœ ์ด๋™
2. "Terraform Destroy Development Environment" ์›Œํฌํ”Œ๋กœ์šฐ ์„ ํƒ
3. "Run workflow" ๋ฒ„ํŠผ ํด๋ฆญ
4. ๋‹ค์Œ ์ •๋ณด ์ž…๋ ฅ:
- `confirm_destroy`: "DESTROY" ์ž…๋ ฅ
- `reason`: ์‚ญ์ œ ์ด์œ  ์ž…๋ ฅ

### 2. Production ํ™˜๊ฒฝ ์‚ญ์ œ (`destroy_prod.yml`)

**์‚ฌ์šฉ ์‹œ๋‚˜๋ฆฌ์˜ค:**
- ๋‹ค๋ฅธ AWS ๊ณ„์ •์œผ๋กœ ์ด๊ด€ ์‹œ ๊ธฐ์กด ์ธํ”„๋ผ ์‚ญ์ œ
- Production ํ™˜๊ฒฝ ์žฌ๊ตฌ์„ฑ
- ์„œ๋น„์Šค ์ข…๋ฃŒ

**์‹คํ–‰ ๋ฐฉ๋ฒ•:**
1. GitHub ์ €์žฅ์†Œ์˜ Actions ํƒญ์œผ๋กœ ์ด๋™
2. "Terraform Destroy Production Environment" ์›Œํฌํ”Œ๋กœ์šฐ ์„ ํƒ
3. "Run workflow" ๋ฒ„ํŠผ ํด๋ฆญ
4. ๋‹ค์Œ ์ •๋ณด ์ž…๋ ฅ:
- `confirm_destroy`: "DESTROY_PRODUCTION" ์ž…๋ ฅ
- `reason`: ์‚ญ์ œ ์ด์œ  ์ž…๋ ฅ (ํ•„์ˆ˜)
- `backup_required`: ๋ฐฑ์—… ์ƒํƒœ ์„ ํƒ

### 3. ์ „์ฒด ํ™˜๊ฒฝ ์‚ญ์ œ (`destroy_all.yml`)

**์‚ฌ์šฉ ์‹œ๋‚˜๋ฆฌ์˜ค:**
- ๋ชจ๋“  ํ™˜๊ฒฝ์„ ํ•œ ๋ฒˆ์— ์‚ญ์ œ
- ํ”„๋กœ์ ํŠธ ์™„์ „ ์ข…๋ฃŒ
- ์ „์ฒด ์ธํ”„๋ผ ์žฌ๊ตฌ์„ฑ

**์‹คํ–‰ ๋ฐฉ๋ฒ•:**
1. GitHub ์ €์žฅ์†Œ์˜ Actions ํƒญ์œผ๋กœ ์ด๋™
2. "Terraform Destroy All Environments" ์›Œํฌํ”Œ๋กœ์šฐ ์„ ํƒ
3. "Run workflow" ๋ฒ„ํŠผ ํด๋ฆญ
4. ๋‹ค์Œ ์ •๋ณด ์ž…๋ ฅ:
- `confirm_destroy`: "DESTROY_ALL_ENVIRONMENTS" ์ž…๋ ฅ
- `reason`: ์‚ญ์ œ ์ด์œ  ์ž…๋ ฅ (ํ•„์ˆ˜)
- `backup_required`: Production ๋ฐฑ์—… ์ƒํƒœ ์„ ํƒ
- `environments`: ์‚ญ์ œํ•  ํ™˜๊ฒฝ ์„ ํƒ

## ๐Ÿ”’ ๋ณด์•ˆ ๊ณ ๋ ค์‚ฌํ•ญ

### ํ•„์š”ํ•œ GitHub Secrets

๊ฐ ์›Œํฌํ”Œ๋กœ์šฐ๋Š” ๋‹ค์Œ secrets๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค:

**Development ํ™˜๊ฒฝ:**
- `DEV_AWS_ACCESS_KEY_ID`
- `DEV_AWS_SECRET_ACCESS_KEY`
- `DEV_DOMAIN_NAME`
- `RDS_USERNAME`
- `RDS_PASSWORD`

**Production ํ™˜๊ฒฝ:**
- `PROD_AWS_ACCESS_KEY_ID`
- `PROD_AWS_SECRET_ACCESS_KEY`
- `PROD_DOMAIN_NAME`
- `RDS_USERNAME`
- `RDS_PASSWORD`

### ๊ถŒํ•œ ๊ด€๋ฆฌ

- Production ํ™˜๊ฒฝ ์‚ญ์ œ๋Š” ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์ด ์žˆ๋Š” ์‚ฌ์šฉ์ž๋งŒ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค
- ํ•„์š”์‹œ GitHub์˜ ๋ธŒ๋žœ์น˜ ๋ณดํ˜ธ ๊ทœ์น™์„ ํ™œ์šฉํ•˜์—ฌ ์ถ”๊ฐ€ ์Šน์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ตฌํ˜„ํ•˜์„ธ์š”

## ๐Ÿ“ ์‹คํ–‰ ์ „ ์ฒดํฌ๋ฆฌ์ŠคํŠธ

### Development ํ™˜๊ฒฝ ์‚ญ์ œ ์ „:
- [ ] ์ค‘์š”ํ•œ ๋ฐ์ดํ„ฐ๊ฐ€ Production์— ๋ฐฑ์—…๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ
- [ ] ๊ฐœ๋ฐœ ์ค‘์ธ ์ฝ”๋“œ๊ฐ€ ์ €์žฅ์†Œ์— ์ปค๋ฐ‹๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ
- [ ] ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๋“ค์ด ํ•ด๋‹น ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”์ง€ ํ™•์ธ

### Production ํ™˜๊ฒฝ ์‚ญ์ œ ์ „:
- [ ] **๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฑ์—… ์™„๋ฃŒ** (ํ•„์ˆ˜)
- [ ] ์‚ฌ์šฉ์ž์—๊ฒŒ ์„œ๋น„์Šค ์ค‘๋‹จ ๊ณต์ง€
- [ ] ๋„๋ฉ”์ธ DNS ์„ค์ • ๋ฐฑ์—…
- [ ] SSL ์ธ์ฆ์„œ ๋ฐฑ์—… (ํ•„์š”์‹œ)
- [ ] ๋ชจ๋‹ˆํ„ฐ๋ง ๋กœ๊ทธ ๋ฐฑ์—… (ํ•„์š”์‹œ)
- [ ] ๋น„์ฆˆ๋‹ˆ์Šค ์—ฐ์†์„ฑ ๊ณ„ํš ์ˆ˜๋ฆฝ

## ๐Ÿ› ๏ธ ๋ฌธ์ œ ํ•ด๊ฒฐ

### ์ผ๋ฐ˜์ ์ธ ์˜ค๋ฅ˜:

1. **"Destroy ํ™•์ธ์ด ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์Šต๋‹ˆ๋‹ค"**
- ์ •ํ™•ํ•œ ํ™•์ธ ๋ฌธ์ž์—ด์„ ์ž…๋ ฅํ–ˆ๋Š”์ง€ ํ™•์ธ
- ๋Œ€์†Œ๋ฌธ์ž ๊ตฌ๋ถ„ ์ฃผ์˜

2. **"๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฑ์—…์ด ์™„๋ฃŒ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค"**
- Production ํ™˜๊ฒฝ ์‚ญ์ œ ์‹œ ๋ฐฑ์—… ์ƒํƒœ๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ ํƒํ–ˆ๋Š”์ง€ ํ™•์ธ

3. **AWS ๊ถŒํ•œ ์˜ค๋ฅ˜**
- GitHub Secrets์˜ AWS ์ž๊ฒฉ ์ฆ๋ช…์ด ์˜ฌ๋ฐ”๋ฅธ์ง€ ํ™•์ธ
- AWS IAM ์‚ฌ์šฉ์ž์—๊ฒŒ ํ•„์š”ํ•œ ๊ถŒํ•œ์ด ์žˆ๋Š”์ง€ ํ™•์ธ

### ๋ณต๊ตฌ ๋ฐฉ๋ฒ•:

์ผ๋ฐ˜์ ์œผ๋กœ destroy ์ž‘์—…์€ ๋˜๋Œ๋ฆด ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ๋ณต๊ตฌ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ:
1. ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฑ์—…์—์„œ ๋ณต์›
2. Terraform ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ธํ”„๋ผ ์žฌ๊ตฌ์„ฑ
3. DNS ์„ค์ • ์ˆ˜๋™ ๋ณต์›

## ๐Ÿ“ž ์ง€์›

๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๊ฑฐ๋‚˜ ๋„์›€์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ:
1. GitHub Issues์— ๋ฌธ์ œ ๋ณด๊ณ 
2. ํŒ€ ์ฑ„๋„์—์„œ ๋ฌธ์˜
3. ์ธํ”„๋ผ ๊ด€๋ฆฌ์ž์—๊ฒŒ ์ง์ ‘ ์—ฐ๋ฝ

---

**โš ๏ธ ๋งˆ์ง€๋ง‰ ๊ฒฝ๊ณ : ์ด ์›Œํฌํ”Œ๋กœ์šฐ๋“ค์€ ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์—์„œ ๋งค์šฐ ์‹ ์ค‘ํ•˜๊ฒŒ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์‹คํ–‰ ์ „์— ์ถฉ๋ถ„ํ•œ ๊ฒ€ํ† ์™€ ๋ฐฑ์—…์„ ์ง„ํ–‰ํ•˜์„ธ์š”.**


51 changes: 51 additions & 0 deletions .github/workflows/cd_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Terraform Development CD

on:
push:
branches:
- dev
jobs:
terraform-apply:
name: Terraform Apply to Dev
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.12.2

- name: Terraform Init (dev)
run: terraform -chdir=terraform/env/dev init

- name: Create terraform.secret.tfvars for CD
working-directory: terraform/env/dev
run: |
cat > terraform.secret.tfvars << EOF
aws_access_key_id = "${{ secrets.DEV_AWS_ACCESS_KEY_ID }}"
aws_secret_access_key = "${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}"
rds_username = "${{ secrets.RDS_USERNAME }}"
rds_password = "${{ secrets.RDS_PASSWORD }}"
domain_name = "${{ secrets.DEV_DOMAIN_NAME }}"
EOF

- name: Terraform Apply (dev)
working-directory: terraform/env/dev
run: |
terraform apply \
-auto-approve \
-input=false \
-var-file="terraform.secret.tfvars"
52 changes: 52 additions & 0 deletions .github/workflows/cd_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Terraform Production CD

on:
push:
branches:
- prod

jobs:
terraform-apply:
name: Terraform Apply to Prod
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.12.2

- name: Terraform Init (prod)
run: terraform -chdir=terraform/env/prod init

- name: Create terraform.secret.tfvars for CD
working-directory: terraform/env/prod
run: |
cat > terraform.secret.tfvars << EOF
aws_access_key_id = "${{ secrets.PROD_AWS_ACCESS_KEY_ID }}"
aws_secret_access_key = "${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}"
rds_username = "${{ secrets.RDS_USERNAME }}"
rds_password = "${{ secrets.RDS_PASSWORD }}"
domain_name = "${{ secrets.PROD_DOMAIN_NAME }}"
EOF

- name: Terraform Apply (prod)
working-directory: terraform/env/prod
run: |
terraform apply \
-auto-approve \
-input=false \
-var-file="terraform.secret.tfvars"
Loading