In this recipe, we will add subnets to our VPC. Within our VPCs, we can create subnets with different inbound and outbound rules. For example, a web server may be launched into a public subnet and the database servers may be hosted on a private subnet, thereby only opening its database server ports for the public subnet.
Creating subnets in a VPC
Getting ready
Create a VPC with a CIDR block range of 10.0.0.0/16 by following the Creating a VPC in AWS recipe.
How to do it...
We can add subnets to our VPC with a netmask of /24 each, as follows:
- Go to VPC service in the...