Subnets are a part of the VPC. By creating different subnets in the given VPC, you are creating different subnetworks for your infrastructure. The scope of the VPC is the region. VPC cannot span across regions, but it can span across all the availability in that region. The scope of the subnet is the availability zone, and it cannot span across different availability zones in that region. This is very important to understand when you work with subnets, and design the fault tolerant application that spreads across multiple availability zone. Each subnet that you create must be associated with the Route Table. One Route Table can have multiple subnets associated to it.
There are two types of subnets. First, the public subnet; this has a route to the internet. This is the subnet, which is associated with the Route Table that has IGW attached to it. Second, the private subnet...