1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS S3 の VPC エンドポイント

1
Last updated at Posted at 2015-05-17

S3 の VPC エンドポイントとは?

VPC のプライベートサブネット内から、NATインスタンスを介さずにS3にアクセスできるようになる仕組み。VPC内にエンドポイントを作成すると、サブネットから S3 へのアクセスはそのエンドポイントに転送されるようルーティングテーブルに設定され、そのエンドポイントを介してS3にアクセスできる。
なお、EC2インスタンスと同一リージョンのS3のみにアクセス可能であることに注意。

使ってみた

以下は、AWS コンソールからの設定。

Endpoint の作成

VPC の画面の「Endpoint」メニューから作成する。その際に、エンドポイントと紐付けるプライベートサブネットを指定する。すると、ルーティングテーブルに次のようなエントリが追加される。
01-route-table.PNG
最低限必要な設定はこれだけ。

プライベートサブネットからS3へのアクセス

パブリックサブネットにある踏み台インスタンスを経由して、プライベートサブネットのインスタンスにログイン。
ローカルのPCがWindowsなので、やり方はこのあたりを参照:
外部から踏み台サーバ経由の多段SSH接続をWindowsクライアントから行う

すると、aws cli を使って S3 にアクセスできるようになっている。

# バケットの一覧取得
$ aws s3 ls
2015-03-09 23:49:02 <MyBucket1>
2015-05-16 23:45:14 <MyBucket2>
...

# ファイル(適当なテキスト)をアップロード
$ vi test.txt
$ aws s3 cp test.txt s3://<MyBucket1>
upload: ./test.txt to s3://<MyBucket1>/test.txt

エンドポイントの今後

現時点ではS3のエンドポイントしか作成できないが、今後は他のサービス用のエンドポイントも作成できるようになるとのこと。
Amazon S3のVPCエンドポイント

将来的には他のAWSサービスのVPCエンドポイントも作成できるようになります。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?