AWS default VPC setup question

,

I’m looking at my original VPC setup that was there when my account with AWS was opened and I have a couple questions if someone could help with one or more of them:

  1. It looks like there are 3 subnets in each region. Are these the same subnets, but I’m just seeing them in each region? (If I delete the 3 subnets in EU-Ireland, will it delete my subnets in US-West) Or are subnets created individually for each region?

  2. Does the default setup with 3 subnets include both public and private subnets? I don’t see a NAT server running but I am able to create an RDS instance that is private (I assume I shouldn’t be able to do this without a private subnet?)

Any help is much appreciated.


Related discussions:

I believe each VPC is separate in each region and has it’s own set of subnets.

Personally, I do not touch the default VPCs and create my own as-needed.

Does it matter what your subnet CIDR blocks are? Why does my default VPC have 4091 IPs allocated, but the one I created has only 249 and does that affect performance in any way?

Default VPC subnet: 172.31.0.0/16

New VPC subnet: 10.0.0.0/16

I don’t believe it matters, however you should use IP ranges allocated for internal networking like 10.*

I’d take a look at the routing tables underneath the subnets.

If 0.0.0.0/0 is bound to an igw, its a public subnet. If its bound to an interface on an instance, then its private (typically).

The default probably created a bunch of subnets and when you did it manually, you only created a single subnet with a /24 netmask. /24 gives a subnets 256 IPs and Amazon reserves some for AWS (that is why you have 249). The VPC that Amazon created has multiple subnets with larger ranges most likely.

CIDR block range will matter if you want to connect the VPCs or other networks together via VPN. If they are the same, you will not be able to connect them as it will create a conflict of interest.

I personally delete he default VPCs to ensure no one uses them by accident. Does mean if you ever want them back you have to ask AWS support though, haven’t had to so far

I leave it there because sometimes I need to launch one-off instances to quickly test something, but that’s rare and I don’t work with a team.

It is possible to create an object in a ‘public’ subnet that is private ie not have a public address. However, that thing will have great difficulty making outgoing connections. RDS isn’t going to create outgoing connections so isn’t as much an issue.

  1. Different regions have different numbers of availability zones. When a default VPC is created it creates subnets in each AZ. Subnets are VPC bound and VPCs are region bound. If you mess with one subnet in a VPC in a different region it will not affect the other.

  2. Default VPCs have internet gateway’s associated with them on creation. The route tables by default have the private subnet point to local while 0.0.0.0/0 points to the internet gateway

CIDR blocks as mentioned previously do matter if they overlap with some internal space and want to VPN.

You can put a support ticket in and they’ll recreate it. You can also just create your own new VPC, wire everything up and use it as your new VPC.

I’m not sure I follow. You can create it in a “public” subnet but not associate an EIP/PublicIP and it won’t be able to be hit from externally. It also wouldn’t be able to go out to the internet. For example if you have RDS, you can put it in a private subnet and have 0.0.0.0/0 route to a NAT instance. This would allow it out but only be hit by private IPs you allow in security groups.

You followed perfectly.

I had to setup VPCs for the first time recently, it had always been done by somebody else.

I found this guide pretty handy.