Test Knowledge on aws đź’»

This is Day 47 of #90daysofdevops challenge

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: Deploy, Monitor, and Troubleshoot a Web Server on AWS EC2

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

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

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

Launch EC2 Instance:

  • Access the AWS Management Console.

  • Navigate to the EC2 service.

  • Launch a new EC2 instance as we have seen in our previous blogs.

  • Select free tier t2 micro.

  • Configure the instance details, such as instance type, VPC, subnet, and security group settings.

  • Create or use an existing key pair to enable SSH access to the instance.

  • Launch the instance.

Connect to EC2 Instance:

  • Once the instance is running, connect to it using SSH from your local machine.

Install Web Server:

  • Update the package manager on the EC2 instance: sudo apt update -y

  • Install the Apache Web Server on the EC2 instance: sudo apt install apache2 -y

Deploy a Simple Web Application:

  • Edit the index.html file using vi or nano editor

  • Insert the basic web page html css code into index file

Monitor EC2 Instance with Amazon CloudWatch:

  • Go to the AWS CloudWatch service in the AWS Management Console.

  • Click on "Create alarm"

  • On Specify metric and conditions page click on Select metric.

  • Select the EC2 metric to monitor, such as CPU utilization or network traffic.

  • Configure conditions and click “Next” button.

  • Set up alarm parameters of notification settings.

  • Give name for alarm and click on next then preview the page and click on “Create alarm”.

  • Alarm for CPU utilization is created successfully.

Task-02: Auto Scaling and Monitoring with AWS Console and CLI

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

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

  • 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.

Create template from instance:

Create an Auto Scaling Group (ASG) using the AWS Management Console:

  1. Log in to your AWS Management Console.

  2. Navigate to the Auto Scaling service.

  3. Create a new Auto Scaling group.

  4. Configure the launch template or configuration for the instances in the group.

  5. Set up the scaling policies, including minimum and maximum instances.

  • Now provide Desired Capacity, Minimum and Maximum Capacity.

  • Take a Review of Configuration and Hit the “Create Auto Scaling Group” Button.

  • The Auto-scaling group is now created.

Monitor the ASG and EC2 Instances using Amazon CloudWatch:

  • You can add the same to the already created dashboard in AWS CloudWatch.

  • Same can be setup to trigger an e-mail by setting a CloudWatch alarm which we have in above task for instance monitoring.

Verify ASG State Using AWS CLI:

  1. Install and configure the AWS CLI on your local machine.

  2. Use AWS CLI commands to view information about the Auto Scaling group and instances.

  • Provide Access Key ID, Secret Access Key, Region Name and Output Format.

  • You can verify the running Auto-scaling group with the AWS CLI command.
aws autoscaling describe-auto-scaling-groups

  • To verify EC2 instance use this command:
aws autoscaling describe-auto-scaling-instances

"Thank you for enjoying my DevOps blog! Your positive response fuels my passion to dive deeper into technology and innovation.

Stay tuned for more captivating DevOps articles, where we'll explore this dynamic field together. Follow me on Hashnode and connect on LinkedIn (https://www.linkedin.com/in/som-shanker-pandey/) for the latest updates and discussions.

Did you find this article valuable?

Support Som Pandey's blog by becoming a sponsor. Any amount is appreciated!

Â