We will create a VPC with two public and private subnets in two different availability zones. Instances created in public subnet can have public IP and route table with a configuration to route traffic on 0.0.0.0/0 to Internet Gateway (igw). Instances created in private subnet will only have a private ip and cannot be accessed from internet. They are accessable only from public subnets. Usually, internet facing load balancers are created in public subnets. Most of the servers like API servers will be in private subnets.
Use cloudformation script to create VPC automatically.