How to create a no-internet access (private) subnet?

0

Points of My Scenario:

  1. I tried to create 3 private subnets (subnets without an internet gateway) so that EC2 instances would be unable to access Internet
  2. I used the procedure in AWS document https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html
  3. Upon completion, I checked the route table for each subnet...
  4. Alas! Each one had destination 0.0.0.0/0 associated with the default igw-<GUID>: just like the other system-generated subnets.

Question: why is this happening and how can I create truly private subnets?

質問済み 1年前658ビュー
1回答
3
承認された回答

In your VPC is a default route table. The instructions on that page don't mention it but if you don't assign a specific route table to a subnet the default is used. In your case, the default route table has a route to the Internet Gateway.

To fix this, create a new route table in your VPC and assign it to the private subnets.

profile pictureAWS
エキスパート
回答済み 1年前
profile pictureAWS
エキスパート
レビュー済み 1年前
  • OMG! That's it! That works! A bundle of thanks, Brettski-AWS!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ