This is a step-by-step rundown on how you can use TotalCloud to deploy a 3 Tier Application. The AWS services used as part of this workflow include Elastic Compute Cloud (EC2), Auto Scaling Group, Virtual Private Cloud(VPC), The Internet Gateway, Elastic Load Balancer (ELB), and EC2 Security Groups.
Step 1: Setup the Virtual Private Cloud (VPC) Give your VPC a name and a CIDR block of 10.0.0.0/16 Action Node:
EC2 Create VPC
Step 2: Create 4 Subnets
The subnet is a way for us to group our resources within the VPC with their IP range. A subnet can be public or private. For our setup, we shall be creating the following subnets with the corresponding IP ranges.
demo-public-subnet-1 | CIDR (10.0.1.0/24)
demo-public-subnet-2 | CIDR (10.0.2.0/24)
demo-private-subnet-3 | CIDR (10.0.3.0/24)
demo-private-subnet-4 | CIDR(10.0.4.0/24)
EC2 Create Subnetx4
Step 3: Setup the Internet Gateway
The Internet Gateway allows communication between the EC2 instances in the VPC and the internet.
EC2 Create Internet Gateway
Step 4: Attach the VPC to the Internet Gateway
EC2 Attach Internet Gateway
Step 5:Create Two Route Tables
The route tables are a set of rules that dictates the movement of data within the network. For our architecture, we create two route tables, one private and one public.
The public route table will define which subnets that will have direct access to the internet while the private route table will define which subnet goes through the NAT gateway.
EC2 Create Route Tablex2
EC2 Create Route
EC2 Create Associate Route Tablex4
Step 6: Create Elastic Load Balancer
The idea of the load balancer is to allow the distribution of load across the EC2 instances used for the application.
ELBv2 Create Load Balancer
Step 7: Create and Modify the Target Group
We need to configure our Target Group to have the Target type of instance. We will give the Target Group a name that will enable us to identify it. This will be needed when we will create our Auto Scaling Group.
ELBv2 Create Target Group
ELBv2 Modify Target Group Attributes
ELBv2 Create Listener
Step 8: Auto Scaling Group
Auto Scaling Group can automatically adjust the size of the EC2 instances serving the application based on need. This makes it a better approach than directly attaching the EC2 instances to the load balancer.
AutoScaling CreateLaunch configuration
Create Auto Scaling Group
Step 9: Create an RDS DB Instance Action Nodes:
RDS Create DB Subnet
RDS Create DB Instance