AWS

AWS : 3 Tier [์ดˆ๊ธฐ ์„ค์ • ๋ฐ ์ž‘์—…]

NENGIN 2024. 11. 19. 17:55

์ฐธ์กฐ๋งํฌ

 

0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” AWS ๊ณต๋ถ€ - 3 Tier ๊ตฌ์ถ• 1ํŽธ - ๊ตฌ์ถ• ๊ณ„ํš & VPC & Bastion Host

AWS 3 Tier ๊ตฌ์ถ•ํ•˜๊ธฐ 1ํŽธ - ๊ตฌ์ถ• ๊ณ„ํš / ๋„คํŠธ์›Œํฌ ๊ตฌ์ถ• / Bastion Host ๊ตฌ์ถ•

velog.io

 

 

 

 

1. ๊ตฌ์„ฑ๋„



 

2. vpc ๋ฐ ์„œ๋ธŒ๋„ท ์„ค์ •

์„œ๋ธŒ๋„ท ๋Œ€์—ญ ๊ณต์ธ IP ํ—ˆ์šฉ ํฌํŠธ
public nat 10.0.118.0/28 ํƒ„๋ ฅ์  IP  
public bastion 10.0.118.16/28 ํƒ„๋ ฅ์  IP 22
private web1 10.0.118.32/28   80, 22
private web2 10.0.118.48/28   80, 22
private was1 10.0.118.64/28   8080, 22
private was2 10.0.118.80/28   8080, 22
private db1 10.0.118.96/28   3306, 22
private db2 10.0.118.112/28    

 

 

3. ๋„คํŠธ์›Œํฌ ๊ตฌ์ถ•

3-1 VPC ์ƒ์„ฑ

 

3-2 Subnet ์ƒ์„ฑ

์œ„์˜ vpc๋ฐ ์„œ๋ธŒ๋„ท ์„ค์ • ํ‘œ์— ๋งž๋„๋ก 8๊ฐœ ์„œ๋ธŒ๋„ท ์ƒ์„ฑํ•˜๊ธฐ

๋ฉ€ํ‹ฐ์กด(A,C)์„ ๊ตฌ์„ฑํ•œ ์ด์œ ๋Š” ๋™์ผํ•œ ๊ฐ€์šฉ์˜์—ญ์— ๋ชจ๋“  ์„œ๋ฒ„๋ฅผ ๋„ฃ๊ฒŒ ๋œ๋‹ค๋ฉด

๊ฐ€์šฉ์˜์—ญ์— ์žฅ์• ๊ฐ€ ์ƒ๊ฒผ์„๋•Œ ๋Œ€์ฒด ํ•  ์ˆ˜ ์žˆ๋Š” ์„œ๋ฒ„๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค

 

3-3 Internet gateway ์ƒ์„ฑ

Internet gateway๋ฅผ ์ƒ์„ฑํ•œ ํ›„ ์ƒ์„ฑํ–ˆ๋˜ vpc๋ฅผ ์—ฐ๊ฒฐํ•˜๊ธฐ

 

3-4 Routing table ์ƒ์„ฑ

๋จผ์ € ๋ชจ๋“  IP ์ฃผ์†Œ์— ๋Œ€ํ•ด ์ธํ„ฐ๋„ท ๊ฒŒ์ดํŠธ์›จ์ด๋กœ ๋ผ์šฐํŒ…ํ•˜๊ฒŒ๋” ์„ค์ •ํ•˜๊ธฐ

local์€ ๊ธฐ๋ณธ ๋ผ์šฐํŒ… ์„ค์ •์œผ๋กœ VPC ๋‚ด๋ถ€ ๋„คํŠธ์›Œํฌ์— ๋Œ€ํ•œ ํŠธ๋ž˜ํ”ฝ์€ local(๋‚ด๋ถ€ ํ†ต์‹ )ํ•˜๊ฒŒ๋” ์„ค์ •๋œ ๊ฒƒ์ด๋‹ค

Public ์„œ๋ธŒ๋„ท์„ ์—ฐ๊ฒฐํ•˜๊ธฐ

 

3-5 NAT gateway ์ƒ์„ฑ

์„œ๋ธŒ๋„ท์ด private์ด๋ฉด ์™ธ๋ถ€์™€ ํ†ต์‹ ์ด ์•ˆ๋˜๊ธฐ ๋•Œ๋ฌธ์— public์œผ๋กœ ์ง€์ •ํ•˜๊ธฐ

ํƒ„๋ ฅ์  IP๋Š” ์™ธ๋ถ€์™€ ํ†ต์‹ ํ•˜๊ธฐ ์œ„ํ•œ IP๋กœ ํ• ๋‹น๋ฐ›์€ IP๋Š” ์™ธ๋ถ€์™€ ํ†ต์‹ ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ์ถœ๋ฐœ์ง€ IP์ด๋‹ค

 

3-6 NAT Routing Table ์ƒ์„ฑ

๋ชจ๋“  IP์— ๋Œ€ํ•ด NAT gateway๋ฅผ ์„ค์ •ํ•˜๊ธฐ

private subnet์„ ๋ชจ๋‘ ์—ฐ๊ฒฐํ•˜๊ธฐ

 

์ธ์Šคํ„ด์Šค ์‚ฌ์–‘

Server Spec OS Volume Public IP Application Version
Bastion t2.micro Amazon Linux 8 GB O X X
WEB01 t2.small Amazon Linux 20 GB X Apache 2.4.X
WEB02 t2.small Amazon Linux 20 GB X Apache 2.4.X
WAS01 t2.small Amazon Linux 30 GB X Tomcat 9.0.97
WAS02 t2.small Amazon Linux 30 GB X Tomcat 9.0.97
DB t2.medium Amazon Linux 30 GB X MySQL 8.X

ํ˜ผ์ž ๊ฐœ๋ฐœ/ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ณผ์ •์ด๊ธฐ ๋•Œ๋ฌธ์— t2.~ ์œ ํ˜•์œผ๋กœ ๊ตฌ์„ฑํ•œ๋‹ค

์‹ค์ œ ๊ฐœ๋ฐœํ™˜๊ฒฝ์—์„œ๋Š” t3.~ ์ •๋„๊ฐ€ ์•ˆ์ •์ ์œผ๋กœ ์‹คํ–‰๋  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒํ•œ๋‹ค

 

4. Bastion Host

4-1 ๋ณด์•ˆ๊ทธ๋ฃน ์ƒ์„ฑ

Bastion ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ์„ ์œ„ํ•œ ๋ณด์•ˆ๊ทธ๋ฃน์„ ์ƒ์„ฑํ•œ๋‹ค

์ธ๋ฐ”์šด๋“œ ๊ทœ์น™์€ ๋‚˜์˜ IP๋งŒ SSH๋ฅผ ํ—ˆ์šฉํ•˜๊ณ  ์•„์›ƒ๋ฐ”์šด๋“œ๋Š” ๋‚˜๋จธ์ง€ ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“  ํ›„ ์ถ”๊ฐ€ํ•œ๋‹ค

 

4-2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ

์ธ์Šคํ„ด์Šค ์‚ฌ์–‘ํ‘œ์— ๋งž๋„๋ก ์ƒ์„ฑํ•œ๋‹ค

 

4-3 ํƒ„๋ ฅ์  IP ์—ฐ๊ฒฐ

์šฐ์„  ํƒ„๋ ฅ์  IP๋ฅผ ํ• ๋‹นํ•œ ํ›„ Bastion ์ธ์Šคํ„ด์Šค์™€ ์—ฐ๊ฒฐํ•œ๋‹ค

Bastion host์˜ ํผ๋ธ”๋ฆญ IP๊ฐ€ ํ• ๋‹น๋˜์—ˆ๋‹ค

 

4-4 Bastion Host SSH ์ ‘์†

mobaXterm์—์„œ ์ ‘์†ํ•œ๋‹ค

 

 

 

 

๋‹ค์Œ ๊ธ€์€ WEB & ALB ์ƒ์„ฑ์œผ๋กœ ์ด์–ด์ง‘๋‹ˆ๋‹ค

 

AWS : 3 Tier [WEB & ALB ์ƒ์„ฑ]

์ด์ „ ๊ธ€์—์„œ ์ด์–ด์ง‘๋‹ˆ๋‹ค AWS : 3 Tier [์ดˆ๊ธฐ ์„ค์ • ๋ฐ ์ž‘์—…]์ฐธ์กฐ๋งํฌ 0๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜๋Š” AWS ๊ณต๋ถ€ - 3 Tier ๊ตฌ์ถ• 1ํŽธ - ๊ตฌ์ถ• ๊ณ„ํš & VPC & Bastion HostAWS 3 Tier ๊ตฌ์ถ•ํ•˜๊ธฐ 1ํŽธ - ๊ตฌ์ถ• ๊ณ„ํš / ๋„คํŠธ์›Œํฌ ๊ตฌ์ถ• / Bastion Hos

nenjin.tistory.com