Create VPC & Subnets
In this part, we are going to setup a VPC where we will be able to host our QR Code App. This will include public subnets with an internet gateway, and private subnet that can't be accessed over the internet.
We're going to end up with a VPC that looks something like this:
We're going to have two subnets for each part of the application.
- Two public subnets for the application load balancer
- Two private subnets for the application servers
- Two private subnets for the database
This could be a different number of subnets, but we want to have at least two availability zones for redundancy.
So each part of the application will be able to exist in two different availability zones. In a real production application, we would probably want to have more, but this is good for now.
Once we've setup the VPC and subnets, we'll deploly the three tier application like this:
We will have to manually manage the load balancer and application servers, but the database will be managed by RDS. Again, in production we would let RDS replicate the database across multiple availability zones. Since we're using the free tier, it will only create a single instance in one AZ, but we'll still create two AZs for it to choose from.
In the next section we will also look at auto scaling groups and application load balancers to manage the other parts of the infrastructure for us, but for now, we'll just set those up manually.
VPC
Let's start by setting up a brand new custom VPC.