๐Ÿš€Day 47: Test Knowledge on aws๐Ÿ’ป ๐Ÿ“ˆ

ยท

4 min read

๐Ÿš€Day 47: Test Knowledge on aws๐Ÿ’ป ๐Ÿ“ˆ

Today, we will be test the aws knowledge on services in AWS, as part of the 90 Days of DevOps Challenge.

Task-01

Launch an EC2 instance using the AWS Management Console and connect to it using SSH.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

Click on the "Connect" button to view the connection details.

Connect to the instance using the SSH client of your choice

Install a web server on the EC2 instance and deploy a simple web application.

Once connected to the instance, update the package manager and install the web server (e.g. Apache, Nginx). here installed apache server using command.

sudo apt-get install apache2

No alt text provided for this image

Monitor the EC2 instance using Amazon CloudWatch and troubleshoot any issues that arise.

Go to the Amazon CloudWatch dashboard.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

Configure the CloudWatch alarm for the selected metric.

Click on the "Create Alarm" button to set up an alarm.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

Task-02

Create an Auto Scaling group using the AWS Management Console and configure it to launch EC2 instances in response to changes in demand.

First create a 'Launch Template' from ec2 instance.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

Use Amazon CloudWatch to monitor the performance of the Auto Scaling group and the EC2 instances and troubleshoot any issues that arise.

Target tracking policy in autoscaling create 2 alarms with 2 different conditions.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image

Once the alarm is set up, it will start monitoring the specified metric for the Auto Scaling group. If the metric exceeds the threshold that you have set, the alarm will be triggered and take the action that you have specified.

Go to auto-scaling group that we created, Click on the "Monitoring" tab and enable "Auto scaling group metric"

You can also create alarm by going to CloudWatch dashboard.

Click on the "Create Alarm" button to set up an alarm.

Use the AWS CLI to view the state of the Auto Scaling group and the EC2 instances and verify that the correct number of instances are running.

Install and configure the AWS CLI on your local machine.

Install aws cli using command

sudo apt-get install awsli

No alt text provided for this image

Use the below command to view the state of the Auto Scaling group and the instances running in it.

aws autoscaling describe-auto-scaling-groups

No alt text provided for this image

Use the below command to view the state of the EC2 instances launched by the Auto Scaling group.

aws ec2 describe-instances

Verify that the correct number of instances are running and that they are healthy and functioning properly.

No alt text provided for this image

Thanks For Reading!!!

ย