본문 바로가기
[AWS-DR]/VPC&Subnet

[중요] AWS VPC Endpoint - 'Interface' vs 'Gateway' type 비교

by METAVERSE STORY 2024. 5. 24.
반응형
728x170

 

 

 

VPC Endpoint의 type 비교(Interface vs Gateway)에 앞서 VPC Endpoint가 무엇인지에 대해 먼저 알아보겠습니다.

VPC Endpoint란?

'Endpoint'란, 말 그대로 '끝점'으로써 어떤 요청의 '목적지'를 의미합니다.
VPC Endpoint는 VPC와 Endpoint service를 연결하는 역할을 합니다.

VPC(Service consumer) → VPC Endpoint  Endpoint Service(Service provider)

이해를 위해 예시를 들어보면,
EC2에서 VPC Endpoint를 통해 S3에 접근하는 경우(ex. EC2에서 S3 버킷 조회를 위한 aws s3 ls를 수행) 아래와 같이 트래픽이 전송됩니다.

EC2(Service consumer) → VPC Endpoint  S3(Service provider)

VPC Endpoint 사용 X

위에서 예시로 든 'EC2에서 S3 버킷 조회를 위한 aws s3 ls를 수행' 할 때 VPC Endpoint를 생성하지 않았다면 아래와 같은 방식으로 통신이 이루어질 겁니다.

VPC Endpoint를 생성하지 않아 Public 망을 통해 트래픽을 전송한다면 보안에 취약할 수 있고, VCP Endpoint를 사용하여 Private 통신을 하는 경우에 비해 속도가 느릴 수 있습니다.

그렇다면 VPC Endpoint를 생성할 경우에는 트래픽이 어떻게 전송될까요?

VPC Endpoint Type

VPC Endpoint의 타입에는 두 종류가 있습니다.

  • Interface type (AWS PrivateLink 사용 O)
  • Gateway type (AWS PrivateLink 사용 X)

Interface type

Interface type의 Endpoint를 생성하면, 생성 시 선택한 Subnet에 ENI가 생깁니다.
이 ENI가 EC2(Serevice consumer)와 S3(Service provider)를 연결하는 Endpoint 역할을 하며 ENI와 S3 사이는 PrivateLink로 연결됩니다.

VPC Endpoint의 Security group Rule 설정 시 Outbound Rule 설정은 필요하지 않으며, Inbound Rule만 오픈해 주면 됩니다.

Gateway type

Internet gateway나 NAT 없이도 Gateway Endpoint로의 라우팅을 통해 S3 및 DynamoDB와의 통신이 가능하며 Interface type의 Endpoint와는 다르게 PrivateLink를 사용하지 않습니다.

Gateway Endpoint를 생성하면, 자동으로 S3(Service provider)에 대한 Managed prefix list가 생성되며 Endpoint 생성 시 선택한 Subnet의 Route table에는 생성된 Managed prefix list 트래픽을 Gateway Endpoint로 보내는 라우팅 설정이 자동으로 추가됩니다.


AWS VPC Endpoint에 대해 알아보았습니다.

정리해 보면,
Interface type은 말 그대로 Service consumer와 Service provider 사이를 'ENI'라는 인터페이스로 연결하는 방식이고 통신은 Interface Endpoint의 Security group을 통해 제어됩니다.

Gateway type은 Service consumer에서 Gateway Endpoint로의 라우팅을 통해 Service provider로의 통신이 이루어지는 방식이며, Gateway이기 때문에 라우팅 설정만 있을 뿐 Security group은 없습니다.

 

 

 

 

출처 : https://velog.io/@brillog/AWS-VPC-Endpoint-Interface-vs-Gateway-type-%EB%B9%84%EA%B5%90#interface-type

반응형
그리드형

댓글