Subnets
Subnet is short for subnetwork. As we saw at the beginning of this chapter, a network is subdivided into multiple logical parts for controlling access to individual logical subparts of the network. When we create a subnet, we need to specify a unique CIDR block for the subnet. This CIDR block has to be a subset of the VPC CIDR block. Each subnet must reside entirely within a single AZ as a subnet cannot span multiple AZs.
Subnets are categorized as public and private subnets based on their security profile, or in other words, based on their route table. We will now discuss different types of subnets.
Private subnets
A private subnet is a subset of a network wherein resources within a subnet are isolated and restricted for access from within the VPC. Any incoming traffic from the internet cannot directly access the resources within a private subnet. Similarly, outgoing traffic from a private subnet cannot directly access the internet. Outgoing traffic to the internet is either restricted...