Kshitij Kohli
Kshitij Kohli

Reputation: 4393

Can VPC with Internet Gateway attached have private subnets?

My understanding is - Yes. For a subnet to be public,

  1. The VPC to which it belongs to should have an Internet Gateway attached
  2. Route should exist in Subnet's route table to Internet Gateway

So this makes me believe that just attaching Internet Gateway doesn't make it's subnets public, and private subnets can exist in a VPC with an attached IGW.

Is my understanding correct?

Upvotes: 0

Views: 772

Answers (1)

jellycsc
jellycsc

Reputation: 12349

Yes, your understanding is correct. That's exactly how you have both public and private subnets in the same VPC.

Upvotes: 3

Related Questions