AWS VPC 인프라 톡합 ꡬ성 - 25λ…„ 05μ›”

AWS VPC 인프라 톡합 ꡬ성 - 25λ…„ 05μ›”

image-20250509-055636.png
QueryPie on AWS - Reference Architecture

Disclaimer

이 λ¬Έμ„œλŠ” High Availability 섀정을 ν¬ν•¨ν•˜μ—¬, Reference Architecture λ₯Ό λ…λ¦½μ μœΌλ‘œ μƒˆλ‘œ κ΅¬μ„±ν•˜λŠ” 과정을 μ˜ˆμ‹œμ μœΌλ‘œ μ œκ³΅ν•˜λŠ” λ¬Έμ„œμž…λ‹ˆλ‹€. 이 λ¬Έμ„œμ—μ„œ μ œμ‹œν•˜λŠ” VPC 생성, Security Group 생성 방식 λ“± μ„€μ •λ‚΄μš©μ€ 참쑰용으둜 μ œμ‹œν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.

μ‹€μ œ μ„€μΉ˜ ν™˜κ²½μ—μ„œλŠ” μƒˆλ‘œμš΄ VPC, Subnets κ°€ μ•„λ‹ˆλΌ, κΈ°μ‘΄ VPC, Subnets 내에 QueryPie λ₯Ό μ„€μΉ˜ν•˜λŠ” 것이 μ μ ˆν•  κ°€λŠ₯성이 λ†’μŠ΅λ‹ˆλ‹€.

μ‹€μ œ μ„€μΉ˜ ν™˜κ²½μ—μ„œλŠ” ν•΄λ‹Ή ν™˜κ²½μ˜ νŠΉμ„±μ„ κ³ λ €ν•˜μ—¬, μ‹œμŠ€ν…œμ„ κ΅¬μ„±ν•˜μ‹œκΈ° λ°”λžλ‹ˆλ‹€.

VPC

AZ 의 선택은 Subnet 을 ꡬ성 μ‹œ ν• λ‹Ήλ©λ‹ˆλ‹€.

VPC λŠ” ν•˜λ‚˜μ˜ 리전(e.g. ap-northeast-2) κΈ°μ€€μœΌλ‘œ 볡수의 AZ λ₯Ό 걸친 ν˜•νƒœλ‘œ ꡬ성할 수 μžˆμŠ΅λ‹ˆλ‹€.

λ…Όλ¦¬μ μœΌλ‘œ 격리된 가상 λ„€νŠΈμ›Œν¬λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.

생성 경둜: VPC dashboard β†’ Virtual private cloud β†’ Your VPCs β†’ Create VPC

VPC Settings

  • Resources to create: VPC only

  • Name tag: 식별 κ°€λŠ₯ν•œ VPC 이름 μ§€μ •

  • IPv4 CIDR block: IPv4 CIDR manual input

  • IPv4 CIDR: VPC 에 ν• λ‹Ήν•  IP block λ²”μœ„λ₯Ό μ§€μ •

  • IPv6 CIDR block: No IPv6 CIDR block

  • Tenancy: Default

Create VPC 클릭

VPC 생성 μ‹œ main route table 이 μžλ™μœΌλ‘œ μƒμ„±λ©λ‹ˆλ‹€.

Subnets

VPC μ—μ„œ ν•˜λ‚˜μ˜ AZ λ₯Ό μ§€μ •ν•˜μ—¬ Subnet λŒ€μ—­μ„ μƒμ„±ν•©λ‹ˆλ‹€.

Subnet 은 생성 방법둠에 따라 Private Subnet / Public Subnet으둜 λ‚˜λ‰©λ‹ˆλ‹€.

생성 경둜: VPC dashboard β†’ Virtual private cloud β†’ Subnets β†’ Create subnet

VPC

  • VPC ID: Subnet 을 생성할 VPC λ₯Ό 선택

Subnet settings

  • Subnet name: 식별 κ°€λŠ₯ν•œ Subnet 이름 μ§€μ •

  • Availability Zone: ν•΄λ‹Ή 리전에 λ§΅ν•‘ν•  AZ 선택

  • IPv4 VPC CIDR block: (VPC 에 ν• λ‹Ήν•œ CIDR block 이 μ—¬λŸ¬κ°œμΈ 경우) CIDR block 을 선택

  • IPv4 subnet CIDR block: Subnet 에 ν• λ‹Ήν•  IP block μ§€μ •

ν•„μš” μ‹œ Add new subnet 을 ν΄λ¦­ν•˜μ—¬ ν•„μš”ν•œ 만큼의 Subnet을 μΆ”κ°€ μ •μ˜ν•©λ‹ˆλ‹€.

μ •μ˜κ°€ λλ‚˜λ©΄ Create subnet 을 클릭 ν•©λ‹ˆλ‹€.

Private subnet κ³Ό Public subnet 을 각각 μƒμ„±ν•©λ‹ˆλ‹€.

Subnet 생성 μ‹œ main Network ACL 이 μžλ™μœΌλ‘œ μƒμ„±λ©λ‹ˆλ‹€.

Route table 은 main route table 이 μžλ™μœΌλ‘œ ν• λ‹Ήλ©λ‹ˆλ‹€.

RDS Subnet groups

Amazon RDS 생성 μ‹œ μœ„μΉ˜ν•  Subnet group을 μƒμ„±ν•©λ‹ˆλ‹€.

Subnet group은 사전에 μƒμ„±ν•œ VPC (Private) Subnet μ—μ„œ, RDS λ₯Ό ν• λ‹Ήν•  μ˜μ—­μ„ κ·Έλ£Ήν™”ν•©λ‹ˆλ‹€.

RDSλ₯Ό Multi-AZ DB clusters둜 ꡬ성 μ‹œμ—λŠ”, 3개의 μ„œλ‘œ λ‹€λ₯Έ AZ 에 μœ„μΉ˜ν•œ 3개의 Subnet 을 μƒμ„±ν•˜μ—¬μ•Ό ν•©λ‹ˆλ‹€.

생성 경둜: Amazon RDS β†’ Subnet groups β†’ Create DB subnet group

Subnet group details

  • Name: 식별 κ°€λŠ₯ν•œ Subnet group 이름 μ§€μ •

  • Description: 생성 μš©λ„λ₯Ό κ°„λž΅ν•˜κ²Œ μž‘μ„±

  • VPC: μœ„μ—μ„œ μƒμ„±ν•œ VPC 선택

Add subnets

  • Availability Zones: Private subnet 이 μ‘΄μž¬ν•˜λŠ” AZ 선택

  • Subnets: Private subnet κΈ°μ€€μœΌλ‘œ 2개 이상 선택 (Multi-AZ DB clusters 의 경우 3개 이상)

Create 클릭

ElastiCache Subnet groups

생성 경둜: Amazon ElastiCache β†’ Configurations β†’ Subnet groups β†’ Create subnet group

Amazon ElastiCache 생성 μ‹œ μœ„μΉ˜ν•  Subnet group을 μƒμ„±ν•©λ‹ˆλ‹€.

Subnet group은 사전에 μƒμ„±ν•œ VPC (Private) Subnet μ—μ„œ, ElastiCache λ₯Ό ν• λ‹Ήν•  μ˜μ—­μ„ κ·Έλ£Ήν™”ν•©λ‹ˆλ‹€.

Subnet group settings

  • Name: 식별 κ°€λŠ₯ν•œ Subnet group 이름 μ§€μ •

  • VPC ID: μœ„μ—μ„œ μƒμ„±ν•œ VPC 선택

  • Selected subnets: Private subnet κΈ°μ€€μœΌλ‘œ 2개 이상 선택

Create 클릭

Internet gateways

Public Subnet μ—μ„œ 외뢀와 μ–‘λ°©ν–₯ 톡신이 κ°€λŠ₯ν•˜λ„λ‘ κ²Œμ΄νŠΈμ›¨μ΄λ₯Ό 생성 및 ν• λ‹Ή ν•©λ‹ˆλ‹€.

Internet gateway 생성

생성 경둜: VPC dashboard β†’ Virtual private cloud β†’ Internet gateways β†’ Create internet gateway

Internet gateway settings

  • Name: 식별 κ°€λŠ₯ν•œ igw 이름 μ§€μ •

Create internet gateway 클릭

Internet gateway VPC ν• λ‹Ή

ν• λ‹Ή 경둜: VPC dashboard β†’ Virtual private cloud β†’ Internet gateways β†’ μƒμ„±ν•œ igw 선택 β†’ Actions β†’ Attatch to VPC

VPC

  • Available VPCs: μƒμ„±ν•œ VPC ν• λ‹Ή

Attach Internet gateway 클릭

NAT gateways

Private Subnet μ—μ„œ μ™ΈλΆ€λ‘œλΆ€ν„° μ—…λ°μ΄νŠΈ 정보 등을 받을 수 μžˆλŠ” NATκ²Œμ΄νŠΈμ›¨μ΄λ₯Ό 생성 ν•©λ‹ˆλ‹€.

NATκ²Œμ΄νŠΈμ›¨μ΄λŠ” Public Subnet에 μƒμ„±λ˜λ©°, κ°€μš©ν•  Public Subnet 수 만큼 μƒμ„±ν•©λ‹ˆλ‹€.

생성 경둜: VPC dashboard β†’ Virtual private cloud β†’ NAT gateways β†’ Create NAT gateway

NAT gateway settings

Create NAT gateway 클릭

Route tables

Subnet 의 Route table κ΄€λ¦¬ν•©λ‹ˆλ‹€.

μ—¬κΈ°μ„œλŠ” κΈ°μ‘΄ main route table 을 ν•΄μ œν•˜κ³  각 Subnet μš©λ„μ— λ§žλŠ” Route table을 μƒμ„±ν•˜κ³  ν• λ‹Ήν•©λ‹ˆλ‹€.

Public route table 및 Private route table 생성

생성 경둜: VPC dashboard β†’ Virtual private cloud β†’ Route tables β†’ Create route table

Route table settings

  • Name: 식별 κ°€λŠ₯ν•œ Route table 이름 μ§€μ •

  • VPC: Route table 을 생성할 VPC μ§€μ •

Create route table 클릭

Private μ „μš© Route table κ³Ό Public μ „μš© Route table 을 각각 μƒμ„±ν•©λ‹ˆλ‹€.

Route table 에 Subnet ν• λ‹Ή

μ‹ κ·œ μƒμ„±ν•œ Route table 에 subnet 을 ν• λ‹Ήν•©λ‹ˆλ‹€.

Private route table μ—λŠ” Private subnet 을, Public route table μ—λŠ” Public subnet 을 각각 ν• λ‹Ήν•©λ‹ˆλ‹€.

ν• λ‹Ή 경둜: VPC dashboard β†’ Virtual private cloud β†’ Route tables β†’ μƒμ„±ν•œ route table 선택 β†’ Actions β†’ Edit subnet associations

Available subnets

  • Route table 에 local connection 으둜 λ§΅ν•‘ν•  Subnet μ§€μ •

Save associations 클릭

Public Route table 에 Default Gateway ν• λ‹Ή

μ‹ κ·œ μƒμ„±ν•œ Public Route table 에 인터넷 ꡬ간 톡신을 ν•  수 μžˆλ„λ‘ Default Gateway λ₯Ό ν• λ‹Ήν•©λ‹ˆλ‹€.

ν• λ‹Ή 경둜: VPC dashboard β†’ Virtual private cloud β†’ Route tables β†’ μƒμ„±ν•œ route table 선택 β†’ Actions β†’ Edit routes

Add route 클릭

  • Destination: 0.0.0.0/0

  • Target: Internet Gateway β†’ μƒμ„±ν•œ igw 선택

Save Changes 클릭

Private Route table 에 NAT Gateway ν• λ‹Ή

μΈμŠ€ν„΄μŠ€κ°€ μ‹ κ·œ μƒμ„±ν•œ Private Route table 을 μ΄μš©ν•˜μ—¬ μ—…λ°μ΄νŠΈ 등을 μˆ˜ν–‰ν•  수 μžˆλ„λ‘ NAT gateway λ₯Ό ν• λ‹Ήν•©λ‹ˆλ‹€.

ν• λ‹Ή 경둜: VPC dashboard β†’ Virtual private cloud β†’ Route tables β†’ μƒμ„±ν•œ route table 선택 β†’ Actions β†’ Edit routes

Add route 클릭

  • Destination: 0.0.0.0/0

  • Target: NAT Gateway β†’ μƒμ„±ν•œ NAT gateway 선택

Save Changes 클릭

Security Group

생성 경둜: VPC dashboard β†’ Security β†’ Security groups β†’ Create security group

Basic details

  • Security group name: 식별 κ°€λŠ₯ν•œ Security group 이름 μ§€μ •

  • Description: 생성 μš©λ„λ₯Ό κ°„λž΅ν•˜κ²Œ μž‘μ„±

  • VPC: Security group 을 생성 ν•  VPCλ₯Ό μ§€μ •

Inbound rules

  • Add rule 클릭 ν•˜μ—¬ Inbound rule 을 μƒμ„±ν•œλ‹€ (없을 경우 ALL DENY 둜 λ™μž‘)

  • μ„€μ • μ •λ³΄λŠ” μ•„λž˜ 각 Instance μœ ν˜•λ³„ Detailsλ₯Ό μ°Έμ‘°ν•˜μ—¬ μž‘μ„±ν•©λ‹ˆλ‹€.

Outbound rules

  • μΌλ°˜μ μœΌλ‘œλŠ” 별도 μ§€μ •ν•˜μ§€ μ•Šμ•„λ„ λ©λ‹ˆλ‹€.

Create security group 클릭

Application load balancer

Inbound

Type

Protocol

Port range

Source

Description

Type

Protocol

Port range

Source

Description

HTTPS

TCP

443

μ‚¬μš©μž 접속 λŒ€μ—­

μ‚¬μš©μžμ˜ QueryPie μ›Ή 접속

HTTP

TCP

80

μ‚¬μš©μž 접속 λŒ€μ—­

(Optional) μ‚¬μš©μžμ˜ QueryPie μ›Ή 접속

HTTPS

TCP

443

Windows Server λŒ€μ—­

Windows Server Agent Health Check, API Calls

HTTP

TCP

80

Windows Server λŒ€μ—­

(Optional) Windows Server Agent Health Check, API Calls

Outbound

Type

Protocol

Port range

Destination

Description

Type

Protocol

Port range

Destination

Description

HTTP

TCP

80

QueryPie EC2 instances

Target Group Health Check

Network load balancer

Inbound

Type

Protocol

Port range

Source

Description

Type

Protocol

Port range

Source

Description

Custom TCP

TCP

9000

μ‚¬μš©μž 접속 λŒ€μ—­

(DAC, SAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

6443

μ‚¬μš©μž 접속 λŒ€μ—­

(KAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

7447

μ‚¬μš©μž 접속 λŒ€μ—­

(WAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

40000-40100

μ‚¬μš©μž 접속 λŒ€μ—­

(DAC Only) Accessing QueryPie Agent Proxy for SaaS

Outbound

Type

Protocol

Port range

Destination

Description

Type

Protocol

Port range

Destination

Description

HTTP

TCP

80

QueryPie EC2 instances

Target Group Health Check

Custom TCP

TCP

9000

QueryPie EC2 instances

(DAC, SAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

6443

QueryPie EC2 instances

(KAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

7447

QueryPie EC2 instances

(WAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

40000-40100

QueryPie EC2 instances

(DAC Only) Accessing QueryPie Agent Proxy for SaaS

QueryPie EC2 instances

Inbound

Type

Protocol

Port range

Source

Description

Type

Protocol

Port range

Source

Description

SSH

TCP

22

Bastion Hosts

(Optional) EC2 μ œμ–΄

HTTP

TCP

80

Application Load balancer

QueryPie μ›Ή 접속 / Load balancer Health Check

HTTP

TCP

80

Network Load balancer

Load balancer Health Check

Custom TCP

TCP

9000

Network Load balancer

(DAC, SAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

6443

Network Load balancer

(KAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

7447

Network Load balancer

(WAC) Accessing QueryPie Agent Proxy for General Users

Custom TCP

TCP

40000-40100

Network Load balancer

(DAC Only) Accessing QueryPie Agent Proxy for SaaS

Outbound

Type

Protocol

Port range

Destination

Description

Type

Protocol

Port range

Destination

Description

HTTPS

TCP

443

0.0.0.0/0

External Communications (e.g. Okta, Slack, WAC External Domains)

HTTP

TCP

80

0.0.0.0/0

External Communications (e.g. WAC External Domains)

MySQL/Aurora

TCP

3306

RDS

QueryPie MySQL

Custom TCP

TCP

6379

ElastiCache

QueryPie Redis

(Optional) Bastion host instances

Inbound

Type

Protocol

Port range

Source

Description

Type

Protocol

Port range

Source

Description

SSH

TCP

22

μ‚¬μš©μž 접속 λŒ€μ—­

Private Subnet 의 EC2 instances μ œμ–΄

Outbound

Type

Protocol

Port range

Destination

Description

Type

Protocol

Port range

Destination

Description

All Traffic

ALL

ALL

0.0.0.0/0

Β 

RDS

Inbound

Type

Protocol

Port range

Source

Description

Type

Protocol

Port range

Source

Description

MySQL/Aurora

TCP

3306

QueryPie EC2 instances

QueryPie Database

Outbound: N/A

Type

Protocol

Port range

Destination

Description

Type

Protocol

Port range

Destination

Description

-

-