Lab 6
Lab 6
Lab Ended:
Task 1:
We will first create an image of the web server instance in EC2 service.
Then we will enter the required details and create the AMI of the web server instance
Task 2:
In this task, we will create target groups. For this, we will choose Instance type target:
Then, we will give it a name and choose Lab VPC:
We don’t have any individual instances, so we will not register any target and just make the target
group.
Next, we will create a load balancer of the type “Application”.
Just like target group, we will give it a name and choose Lab VPC:
Next, we will specify which subnets the load balancer should use as shown in the image below:
Next, we will choose web security group and lab group for listening and create the load balancer:
Task 3:
In this task, we will create Launch Template:
We will enter the necessary details to create it as shown in the images:
And we will enable cloud watch monitoring and create the launch template:
Next, we will create auto scaling group for our launch template:
Then we will configure the following network details, similar to the previous tasks we did:
Now, we will attach it to the load balancer we made and enable cloudwatch:
To ensure that always 2-6 instances are running, we will configure the following settings:
To maintain average CPU utilization of 60% across all instances, we will configure these settings:
We will also create a new tag and create our auto scaling group:
Task 4:
Task 5:
First, we will go to cloud watch service and go to all alarms. The two alarms shown below were made by
the auto scaling group, and keep the CPU load to 60%:
The OK indicates that the alarm has not been triggered. It is the alarm for CPU Utilization > 60.
To test this alarm, we will go to load test in our browser application which generates high load:
In 3 minutes, we will see the High Alarm is in alarm state now because of excessive load:
If we go to our instances, we can see the additional instances launched to balance the load by Auto
Scaling:
This shows our system works perfectly.
Task 6:
In this task, we will terminate our Web Server Instance to end our lab. It was created to create AMI for
our auto scaling and is no longer needed.