VPC endpoint: truy cập dịch vụ AWS không qua internet
Workload trong VPC thường xuyên gọi các dịch vụ AWS như S3; theo mặc định, traffic này đi ra ngoài VPC tới endpoint public của dịch vụ, vừa phát sinh chi phí vừa không đi qua mạng riêng.
Các EC2 instance trong private subnet của MFTECH ghi ảnh vào S3 và gửi job vào SQS. Theo mặc định, traffic này đi qua NAT gateway tới public endpoint của dịch vụ. Chọn từng phương án, gửi request và quan sát thay đổi trong route table.
| Destination | Target |
|---|---|
10.0.0.0/16 | local |
0.0.0.0/0 | nat-0a1b (NAT gateway) |
Chi phí là lý do chính để chuyển lưu lượng tới S3 sang gateway endpoint. Thay đổi lượng dữ liệu, Region và số NAT gateway để xem chi phí mỗi tháng của hai phương án:
- Giờ chạy · 1 × 730 giờ × $0,059
- $43,07
- Xử lý dữ liệu · 2.048 GB × $0,059
- $120,83
- Không tính phí giờ chạy và phí xử lý dữ liệu
- $0,00
Với 2 TB mỗi tháng, gateway endpoint loại bỏ $120,83 phí xử lý dữ liệu. Phí giờ chạy $43,07 vẫn còn nếu NAT gateway tiếp tục phục vụ lưu lượng đi Internet.
Giá niêm yết theo giờ và theo GB, kiểm tra lần cuối 2026-10; chưa gồm phí request và phí truyền dữ liệu ra Internet. Trang giá của AWS
Không tính phí; bổ sung route trong route table, traffic không còn đi qua NAT gateway.
- S3 và DynamoDB: gateway endpoint, không tính phí, định tuyến qua route table.
- Dịch vụ khác: interface endpoint, sử dụng ENI, có tính phí.
- Chia sẻ dịch vụ riêng giữa các VPC: PrivateLink kết hợp NLB.
- PrivateLink chỉ cho phía sử dụng khởi tạo kết nối; phía cung cấp không khởi tạo được kết nối vào VPC của phía sử dụng (VPC peering cho phép giao tiếp hai chiều).
- Kết nối qua gateway endpoint không mở rộng ra ngoài VPC: tài nguyên ở phía bên kia của VPN, VPC peering (cùng Region hay khác Region), transit gateway hoặc Direct Connect đều không dùng được gateway endpoint; trường hợp này dùng interface endpoint.
VPC endpoints: reaching AWS services without the internet
Workloads in a VPC call AWS services such as S3 all the time; by default this traffic leaves the VPC for the service’s public endpoint, which adds cost and does not stay on a private network.
EC2 instances in MFTECH’s private subnet write images to S3 and send jobs to SQS. By default, this traffic goes through the NAT gateway to the service’s public endpoint. Choose each option, send a request and watch the change in the route table.
| Destination | Target |
|---|---|
10.0.0.0/16 | local |
0.0.0.0/0 | nat-0a1b (NAT gateway) |
Cost is the main reason to move S3 traffic to a gateway endpoint. Change the data volume, the Region and the number of NAT gateways to see the monthly cost of both options:
- Giờ chạy · 1 × 730 giờ × $0,059
- $43,07
- Xử lý dữ liệu · 2.048 GB × $0,059
- $120,83
- Không tính phí giờ chạy và phí xử lý dữ liệu
- $0,00
Với 2 TB mỗi tháng, gateway endpoint loại bỏ $120,83 phí xử lý dữ liệu. Phí giờ chạy $43,07 vẫn còn nếu NAT gateway tiếp tục phục vụ lưu lượng đi Internet.
Giá niêm yết theo giờ và theo GB, kiểm tra lần cuối 2026-10; chưa gồm phí request và phí truyền dữ liệu ra Internet. Trang giá của AWS
No charge; a route is added to the route table, and traffic no longer goes through the NAT gateway.
- S3 and DynamoDB: gateway endpoint, no charge, routed through the route table.
- Other services: interface endpoint, uses an ENI, charged.
- Sharing a private service between VPCs: PrivateLink combined with an NLB.
- PrivateLink lets only the consumer initiate connections; the provider cannot initiate connections into the consumer VPC (VPC peering allows two-way communication).
- Gateway endpoint connections cannot be extended out of a VPC: resources on the other side of a VPN connection, a VPC peering connection (same Region or another Region), a transit gateway or a Direct Connect connection cannot use a gateway endpoint; use an interface endpoint instead.