How to differentiate between public and private subnet in AWS VPC
When you are starting with AWS VPC and specially when you are working with an existing VPC setup, it’s difficult to differentiate between public and private subnets. As we know, the name is just a tag in AWS, and that doesn’t make sure what it says. So many times, it turns out that the subnet that is named as private isn’t actually private.
In this article, we will try to understand the concept of public/private subnet in AWS VPC and see how to differentiate between them.
First of all, let’s get familiarize ourselves with some terminologies.
VPC : stands for Virtual Private Cloud and is a logically isolated virtual network on top of AWS physical network. So that we can have an isolated environment for our resources and have better control over security.
Subnet: Subnet is a network inside a network (in our case, sub-network inside VPC). Subnets provide better control over the traffic flows in VPC. You can have different IP ranges (CIDRs) for your subnet as per your needs. If you are wondering how to do CIDR calculation and allocation, you might want to look at my article.