13E. RDS DB ์ธ์คํด์ค Security Group ์์ฑ ๋ฐ ์ค์ ํ๊ธฐ
13E. RDS DB ์ธ์คํด์ค Security Group ์์ฑ ๋ฐ ์ค์ ํ๊ธฐ ๊ด๋ จ

RDS DB ์ธ์คํด์ค๊ฐ ์์ ํ ์์ฑ๋์๋๋ผ๋ ์๋ํฌ์ธํธ ์ฃผ์๋ก ์ ์์ด ์๋ฉ๋๋ค. Security Group์์ ์ ์์ด ์ฐจ๋จ๋์ด ์๊ธฐ ๋๋ฌธ์ ๋๋ค.
์ฐ๋ฆฌ๋ DB ์ธ์คํด์ค๋ฅผ ์์ฑํ ๋ Security Group์ ๊ธฐ๋ณธ๊ฐ์ธ default (VPC)๋ก ์ค์ ํ์ต๋๋ค. default (VPC)๋ ๋ชจ๋ ํธ๋ํฝ์ ๋ํด Inbound๊ฐ ์ด๋ ค์์ง๋ง์ ์ ๊ฐ๋ฅํ IP ๋์ญSource์ default ์๊ธฐ ์์ ์ผ๋ก ์ค์ ๋์ด ์์ต๋๋ค. ์ฆ ๊ฐ์ default (VPC) Security Group ์ค์ ์์์๋ง ์ ์์ด ํ์ฉ๋๋ฏ๋ก ์ธ๋ถ์์๋ ์ ์ํ ์ ์์ต๋๋ค. ์ธ๋ถ์์ ์๋ํฌ์ธํธ ์ฃผ์์ ์ ์ํ๋ ค๋ฉด RDS DB ์ธ์คํด์ค(MySQL) ์ ์ฉ Security Group์ ์์ฑํฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ MySQL ํฌํธ(3306)๋ฅผ ์ด์ด์ค์ผ ํฉ๋๋ค.
RDS DB ์ธ์คํด์ค์ฉ Security Group์ ์์ฑํด๋ณด๊ฒ ์ต๋๋ค.

[EC2]
๋ฅผ ํด๋ฆญํฉ๋๋ค.
NETWORK & SECURITY
โ [Security Groups]
๋ฅผ ํด๋ฆญํ ๋ค ์์ชฝ์ [Create Security Group]
๋ฒํผ์ ํด๋ฆญํฉ๋๋ค.RDS DB ์ธ์คํด์ค์ฉ Security Group์ ์์ฑํฉ๋๋ค.
- Security group name: Security Group์ ์ด๋ฆ์ ๋๋ค. MySQL DB Instance๋ฅผ ์ ๋ ฅํฉ๋๋ค.
- Description: Security Group ์ค๋ช ์ ๋๋ค. MySQL DB Instance๋ฅผ ์ ๋ ฅํฉ๋๋ค.
- VPC: Security Group์ด ์ ์ฉ๋ VPC์ ๋๋ค. ๊ธฐ๋ณธ๊ฐ ๊ทธ๋๋ก ์ฌ์ฉํฉ๋๋ค.

[Inbound]
ํญ์ ์ ํํฉ๋๋ค (Inbound๊ฐ ๊ธฐ๋ณธ์ผ๋ก ์ ํ๋์ด ์์ ๊ฒ์
๋๋ค). ์๋์ชฝ [Add Rule]
๋ฒํผ์ ํด๋ฆญํฉ๋๋ค. ์ค์ ์ด ์๋ฃ๋์์ผ๋ฉด [Create]
๋ฒํผ์ ํด๋ฆญํฉ๋๋ค.- Type: ํธ๋ํฝ ์ข ๋ฅ์ ๋๋ค. ์ฐ๋ฆฌ๋ MySQL ํฌํธ(3306)๋ฅผ ์ด์ด์ผ ํ๋ฏ๋ก MySQL์ ์ ํํฉ๋๋ค.
- Protocol: ํํ ๋ก์ฝ์ ๋๋ค. MySQL์ ์ ํํ๋ฉด ์๋์ผ๋ก TCP๊ฐ ์ค์ ๋ฉ๋๋ค.
- Port Range: ํฌํธ ๋ฒํธ์ ๋๋ค. MySQL์ ์ ํํ๋ฉด ์๋์ผ๋ก 3306์ด ์ค์ ๋ฉ๋๋ค.
- Source: ์ ์ ๊ฐ๋ฅํ IP ๋๋ IP ๋์ญ์ ๋๋ค. Anywhere๋ฅผ ์ ํํฉ๋๋ค(์ค๋ฌด์์๋ My IP๋ฅผ ์ ํํ์ฌ ์์ ์ IP๋ง ์ ์ํ ์ ์๋๋ก ์ค์ ํ๊ฑฐ๋, Custom IP๋ฅผ ์ ํํ์ฌ ํน์ IP ๋์ญ์ ์ค์ ํ๋๋ก ํฉ๋๋ค).
Oracle๊ณผ PostgreSQL์ ํฌํธ ๋ฒํธ
MySQL๊ณผ Microsoft SQL Server๋ Security Group์ ์์ฑํ ๋ Type์์ ๋ฏธ๋ฆฌ ์ ์๋ ํธ๋ํฝ ์ข ๋ฅ๋ฅผ ์ ํํ ์ ์์ต๋๋ค. Oracle๊ณผ PostgreSQL์ ๋ฏธ๋ฆฌ ์ ์๋ ๊ฒ์ด ์์ผ๋ฏ๋ก Custom TCP Rule์ ์ ํํ๊ณ ํฌํธ ๋ฒํธ๋ฅผ ์ ๋ ฅํด์ผ ํฉ๋๋ค.
- Oracle: 1521
- PostgreSQL: 5432

[NETWORK & SECURITY]
โ [Security Groups]
)์ MySQL DB Instance Security Group์ด ์์ฑ๋์์ต๋๋ค.์ด์ ๋ค์ RDS DB ์ธ์คํด์ค ๋ชฉ๋ก(Instances)์ผ๋ก ์ด๋ํฉ๋๋ค. DB ์ธ์คํด์ค ๋ชฉ๋ก([Instances]
)์์ DB ์ธ์คํด์ค(exampledbinstance
)๋ฅผ ์ ํํ ๋ค ๋ง์ฐ์ค ์ค๋ฅธ์ชฝ ๋ฒํผ์ ํด๋ฆญํ๋ฉด ํ์
๋ฉ๋ด๊ฐ ๋์ต๋๋ค (์์ชฝ [Instance Actions]
๋ฒํผ์ ํด๋ฆญํด๋ ๊ฐ์ ๋ฉ๋ด๊ฐ ๋์ต๋๋ค).

[Modify]
๋ฅผ ํด๋ฆญํฉ๋๋ค.RDS DB ์ธ์คํด์ค์ ์ค์ ์ ๋ณ๊ฒฝํฉ๋๋ค.

[Continue]
๋ฒํผ์ ํด๋ฆญํฉ๋๋ค.์ค์ ํ ๋ด์ฉ์ ์ด์์ด ์๋์ง ํ์ธํฉ๋๋ค.

[Modify DB Instance]
๋ฒํผ์ ํด๋ฆญํฉ๋๋ค.RDS DB ์ธ์คํด์ค ๋ชฉ๋ก์ ๋ณด๋ฉด exampledbinstance
์ Security Group์ default๊ฐ ์ญ์ ๋๊ณ , MySQL DB Instance๊ฐ ์ถ๊ฐ๋๊ณ ์์ต๋๋ค.

์ด์ ์ธ๋ถ์์ MySQL ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ํ ์ ์๊ฒ ๋์์ต๋๋ค.