Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

AWS - How to implement end to end VPC Endpoint service

VPC Endpoint について

VPC Endpoint とは

異なる VPC、または異なるリージョンに配置された AWS サービス同士の通信を、インターネットを経由することなく Amazon のネットワーク内で繋ぐサービス。

VPC Endpoint の機能

Interface Endpoint、Gateway Load Balancer Endpoint と Gateway Endpoint の3つの機能が提供されている。

各種 VPC Endpoint の使用料金

VPC Endpoint を利用するメリット

  1. 実質的なインターネットとの出入口を封鎖して、セキュアな経路が実現できる。IGW(Internet Gateway)、NATGW が不要になる。

  2. 費用対効果。時間課金は無料か1/6に削減できる。上記、「各種 VPC Endpoint の使用料金」を確認してもらえればわかると思われている。東京リージョンで1時間あたり Interface Endpoint の使用料金は、$0.014 になっており、それに対して、NATゲートウェイの場合、$0.62 である(同じ東京リージョンで1時間に処理データ1GBあたり)。

VPC Endpoint 利用シーン

ユーザーは多くのVPCを管理している場合、プライベートサブネットにあるリソースからAWSのリソースにインターネットを経由せず、セキュアにアクセスする。また、大量に S3 や DynamoDB と通信が発生する場合、VPC Endpoint を使ったら、費用対効果が高くなる。

実践デモ - VPC Endpoint で 2つの VPC 間にエンドツーエンドの接続を設定する

Required Time: 1h30m

Architecture

こちらの構築図で VPC Endpoint の実践デモを作成してみよう。 endpoint_architecture_demo

Step 1. Create a service provider VPC

endpoint_architecture_demo

Step 2. Create and attach an IGW

1. Create Service IGW

endpoint_architecture_demo

2. Attach Service IGW

endpoint_architecture_demo

Step 3. Create a Public subnet

endpoint_architecture_demo

Step 4. Create a Public Route Table and associate it with the subnet

1. Create Service Public Route Table

endpoint_architecture_demo

2. Associate Route Table with Service Public subnet

endpoint_architecture_demo

Step 5. Add the public Route in the Route table

endpoint_architecture_demo

Step 6. Create an EC2 Instance

1. Configure Instance Detail(Subnet)

2. Configure Advanced Details

3. Configure Security Group

endpoint_architecture_demoendpoint_architecture_demo

4. Launch instance

endpoint_architecture_demo

Step 7. Create a Network LoadBalancer

1. Configure LoadBalancer

endpoint_architecture_demoendpoint_architecture_demo

2. Create target group

endpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demo

3. Register targets

endpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demo

4. DNS name

endpoint_architecture_demo
 Welcome to Hangyuzs Server 1 
endpoint_architecture_demo

Step 8. Create an Endpoint service

endpoint_architecture_demoendpoint_architecture_demo

Step 9. Create a customer VPC

endpoint_architecture_demo

Step 10. Create and attach an Internet Gateway

1. Create Customer IGW

endpoint_architecture_demo

2. Attach Customer IGW

endpoint_architecture_demo

Step 11. Create a Public subnet

endpoint_architecture_demo

Step 12. Create a Public Route Table and associate it with the subnet

1. Create Customer Public Route Table

endpoint_architecture_demo

2. Associate Route Table with Customer Public subnet

endpoint_architecture_demo

Step 13. Add the public Route in the Route table

endpoint_architecture_demo

Step 14. Create an EC2 Instance

1. Configure Instance Detail(Customer)

2. Configure Security Group

3. Launch instance

endpoint_architecture_demo

Step 15. Create a VPC Endpoint

1. Configure Endpoint

endpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demo

2. Accept endpoint connection request

endpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demo

Step 16. Test the connectivity

ssh -i {keypair}.pem ec2-user@{Cusotmer_EC2_IPv4_Address}
curl {Endpoint_IPv4_Address}
<html><h1> Welcome to Hangyuzs Server 1 </h1></html>
endpoint_architecture_demo

Step 17. Delete AWS Resources

endpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demoendpoint_architecture_demo