Day 47: Would you like to test your AWS knowledge? ????

Day 47: Would you like to test your AWS knowledge? ????

Task-01

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

To begin creating an instance, click the "Launch Instance" button.

No alt text provided for this image

Choose an AMI from Amazon to utilize for the instance.

No alt text provided for this image

On the basis of your needs and requirements, select an instance type.

No alt text provided for this image

Set up the instance's specifics, including the VPC, subnet, security settings, and storage. the 'Launch instance' button

No alt text provided for this image

A new instance is created.

No alt text provided for this image

To view the connection information, click the "Connect" button.

Make a connection to the instance using your preferred SSH client.

No alt text provided for this image
No alt text provided for this image

Deploy a web server and launch a basic web application on the EC2 instance.

Install the web server and update the package manager once you're linked to the instance (e.g. Apache, Nginx). Using a command, install the Apache server here.

sudo apt-get install apache2        
No alt text provided for this image

Launch the Apache server and verify its status.

No alt text provided for this image

Go inside directory /var/www/html.

No alt text provided for this image

Make a new index.html file that is just a simple HTML page with a form in it.

No alt text provided for this image

paste public IP of your EC2 in the browser to view a straightforward web application.

No alt text provided for this image

Use Amazon CloudWatch to keep an eye on the EC2 instance and resolve any problems that may come up.

See the dashboard for Amazon CloudWatch.

Choose the instance you wish to monitor by going to the Amazon EC2 console.

Enable "Detailed monitoring" by selecting the "Monitoring" tab.

No alt text provided for this image
No alt text provided for this image

Navigate to the "Metrics" page in the Amazon CloudWatch console.

To view the EC2 metrics that are offered, select the "EC2" tab.

No alt text provided for this image

Choose the metric you wish to keep an eye on. You may keep an eye on network traffic, disc I/O, CPU, and memory utilization, for instance. "Pre-instance Metrics" should be clicked.

No alt text provided for this image
No alt text provided for this image

Set the CloudWatch alarm to go off for the chosen measure.

To create an alarm, click the "Create Alarm" button.

No alt text provided for this image

Choose the measure you want to track.

No alt text provided for this image

Choose 'EC2'

No alt text provided for this image

Click on 'Pre-Instance Metrics'

No alt text provided for this image

choosing the measure for CPU utilization

No alt text provided for this image

Choose the scenario that will set off the alert (e.g. when the CPU utilization is above a certain threshold for a certain amount of time).

No alt text provided for this image

50 is the minimum threshold limit.

No alt text provided for this image

Add more alarm parameters by configuring the name, description, and notification options.

No alt text provided for this image

Click on 'Create alarm'

No alt text provided for this image

The alarm has been set off.

No alt text provided for this image

Visit the CloudWatch dashboard to see the instance's stats and logs if an alarm is triggered.

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.

Make a "Launch Template" first using an EC2 instance.

No alt text provided for this image
No alt text provided for this image

A launch template is created.

No alt text provided for this image

To begin the creation process, click the "Create Auto Scaling group" button.

No alt text provided for this image

Choose the launch template that will be applied to the group of instances.

No alt text provided for this image

Choose the instance type and other configuration options, including storage, security groups, a VPC, and a subnet.

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

In order to decide when to start new instances, configure the scaling policies. Configure the instance's intended, minimum, and maximum capacity.

No alt text provided for this image

To set off an alarm, select "Target tracking scaling policy" and "metric type" as CPU use.

No alt text provided for this image

Click on "Create auto-scaling group"

No alt text provided for this image

There is now an auto-scaling group.

No alt text provided for this image

Use Amazon CloudWatch to keep an eye on how the EC2 instances and the Auto Scaling group are performing and to troubleshoot any problems that may come up.

The autoscaling target tracking strategy generates two alerts with two distinct criteria.

No alt text provided for this image

The provided metric for the auto-scaling group will be monitored once the alarm has been set up. The alert will sound, and the action you've specified will be taken if the metric rises above the threshold you've set.

Go to the "Auto scaling group metric" setting in the "Monitoring" tab of the auto-scaling group that we created.

No alt text provided for this image

By heading to the CloudWatch dashboard, you may also generate an alarm.

To create an alarm, click the "Create Alarm" button.

No alt text provided for this image

Click on "EC2".

Click on 'By Auto Scaling Group'.

No alt text provided for this image

Choose the measure you want to keep an eye on. You may look up the metric using its name.

Select any metric that you want to monitor and create an alarm.

if the circumstances are right, take the configured action. The CloudWatch console allows you to modify and update the alarm settings as necessary while also displaying the alarm's status.


Check the status of the Auto Scaling group and the EC2 instances using the AWS CLI to make sure the right number of instances are operating.

On your local computer, install and setup the Amazon CLI.

With a command, install the aws cli

sudo apt-get install awscli        
No alt text provided for this image

Setup your AWS CLI

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

Since we selected a targeted capacity value of 2, the auto-scaling group has launched 2 instances.

To examine the status of the EC2 instances started by the Auto Scaling group, use the command below.

aws ec2 describe-instances        
No alt text provided for this image

Make sure the right number of instances are running, that they are in good condition, and that they are operating as intended.

No alt text provided for this image

Thank you for sticking with me; I hope you learned something. ?? ??

要查看或添加评论,请登录

Vinay Kumar的更多文章

  • DevOps Project - 4 ????

    DevOps Project - 4 ????

    Project Description The project aims to deploy a web application using Docker Swarm, a container orchestration tool…

    7 条评论
  • DevOps Project 3 ????

    DevOps Project 3 ????

    Project Description The project involves hosting a static website using an AWS S3 bucket. Amazon S3 is an object…

    3 条评论
  • DevOps Project -2 ????

    DevOps Project -2 ????

    Project Description The project is about automating the deployment process of a web application using Jenkins and its…

  • Day 80: DevOps Project 1 ????

    Day 80: DevOps Project 1 ????

    Project Description The project aims to automate the building, testing, and deployment process of a web application…

    2 条评论
  • Day 73 - Setup Grafana on AWS EC2 Instance ????

    Day 73 - Setup Grafana on AWS EC2 Instance ????

    Task: Set up grafana in your local environment on AWS EC2. Go to the AWS console and Launch an EC2 instance To enable…

  • Day 72 - Grafana ????

    Day 72 - Grafana ????

    What is Grafana? No matter where your metrics are kept, Grafana is an open-source data visualization and monitoring…

    4 条评论
  • Day71 - Terraform Interview Questions ????

    Day71 - Terraform Interview Questions ????

    1. What is Terraform and how it is different from other IaaC tools? HashiCorp's Terraform is an Infrastructure as Code…

  • Day 70 - Terraform Modules ????

    Day 70 - Terraform Modules ????

    Modules are containers for multiple resources that are used together. A module consists of a collection of .

    4 条评论
  • Day 69 - Meta-Arguments in Terraform ???

    Day 69 - Meta-Arguments in Terraform ???

    When you define a resource block in Terraform, by default, this specifies one resource that will be created. To manage…

    4 条评论
  • Day 65 - Terraform Resources ????

    Day 65 - Terraform Resources ????

    Understanding Terraform Resources A resource in Terraform represents a component of your infrastructure, such as a…

    2 条评论

社区洞察

其他会员也浏览了