Introduction:
Table of Contents
AWS Alarm monitors your Amazon Web Services (AWS) resources and the applications you run on AWS in real time. With help of alarm we will monitor Auto Scaling setups load. For that we have to Create Alarm for AutoScaling Activity
Why we have to create alarm:
- You can create a cloud watch alarm that monitors cloud watch metrics for one of your instances.
- A new notification sent when it reach a threshold you specify.
To Create Alarm for AutoScaling Activity:
- Go to the EC2 dashboard.
- At the end of the left side margin, you will find a Load Balancer.
Fig. EC2 dashboard.
Click on the Load Balancer.
Fig. Load balancer page.
Now create a Load balancer by clicking Create Load balancer.
Fig. Define the Load balancer page.
Give the Load balancer name and Click on Next.
Fig. Assign the Security groups page.
If u have an existing security group select that group
However, you can create a new security group and
Click on Next.
Fig. Configure the Health Check page.
Check the details and click on Next.
Fig. Add the EC2 instances page.
Fig. Add tags page.
Give key names as you want and click on Review and create.
Fig. Review page.
Check the details that you have given and if you have any corrections click on edit and modify and Click on Create.
Fig. A load balancer has created.
How to create Launch Configuration:
- In the EC2 dashboard, you will find Auto scaling at the bottom of the left side menu.
Fig. EC2 dashboard showing auto-scaling.
Click on Launch Configuration.
Fig. Launch configuration page.
Click on Create Launch Configuration.
Fig. Choose the AMI page.
Select Amazon Linux 64 bit.
Fig. Create a Launch Configuration page.
Select type t2.micro and Click on Next.
Fig. Configure the details page.
Give Name- Click on Next.
Fig. Create a Launch Configuration page.
Click on Next.
Fig. configure the security group.
We have to assign a security group if it is already existing.
If it is not present create a new security group.
Select the security groups that already exist.
Click on Review.
Fig. Review of Page.
Verify the details and click on Create Launch Configuration.
Fig. Key pair selection.
- Select the existing key pair or create a new key pair.
- Click on Create Launch Configuration.
Fig. Launch configuration created page.
How to Create Auto Scaling:
- In launch configuration created page click on Create an Auto Scaling group.
Fig. Auto Scaling Group Page.
- Give the Group Name.
- Select all the subnets that are present.
- Click on Advanced Details.
Fig. Advanced Details Page.
- Select the Load balancers which you want balance.
- Select Heath check type EC2.
- Click on Next configure scaling policies.
Fig. Autoscaling Group.
- Select the use of scaling policies for the auto-scaling group.
- The scale should be between 1 and 2 instances.
- Click on the scale of the auto-scaling group at the bottom of the page.
Fig. Increase the group size page.
Now execute policy create an alarm-
Fig. Create an Alarm Page.
- Give the name which you want to send a notification to.
- In with these recipients give the mail ID.
- It gives> the number which you want.
- Change in alarm name
Fig. Alarm page.
- Click on Create Alarm.
Fig. Decrease Group Size page.
- Click on Add Alarm.
Fig. Add the Alarm page.
- A default notification will be selected as we have already created for the increase.
- In IS we have to select <=.
- Change increase and decrease
- Click on create alarm.
In decrease group size take the action from 1, not from and Click on Next.
Fig. Configure Notifications page.
- Send the notification to the default topic.
- Click on Next.
Fig. Configure the Tags page.
- Give a name to the key.
- Click on Review.
Fig. Auto-scaling details.
Fig. scaling policies and remaining details page.
- Check the details and click on Create Auto Scaling Group.
Fig. The Autoscaling group has created
.
Conclusion:
By this, we know how to create a Load balancer, Launch Configuration, and Auto Scaling Groups.