AWS EC2 Automation ☁

AWS EC2 Automation ☁

#90daysofdevopschallenge

#day40

Amazon EC2 (Elastic Compute Cloud):

EC2 is a Virtual Machine on AWS that can compute the services. Amazon EC2 instance eliminates your need to invest in hardware upfront, so you can develop and deploy application statics. You can use Amazon EC2 instance as much as you want, configure networking, and security, and manage storage.

Features of AWS EC2:

  1. Amazon EC2 enables scale-up and scale-down of the instances. On AWS you have to pay per minute and second.

  2. Amazon EC2 has two stores EBS and & an instance store. EBS is persistent but the instance store is non-persistent.

  3. Preconfigure Amazon Machine Template available on Amazon Machine Instance.

  4. By default when you create an Amazon Account is limited to a maximum of 20 instances per EC2 range (one region) with default High I/O instances.

Types Of EC2 Instance:

AMI (Amazon Machine Image):

It is an image that AWS supports and keeps up to date. It contains the information needed to start an instance. When you launch an instance, you must choose an AMI. When you need multiple instances with the same configuration, you can launch them from a single AMI.

Autoscaling Group:

AWS provides an Autoscaling Group Feature to scale up and scale down applications based on defined situations & traffic.

AWS provides four types of Autoscaling.

a) Manual Scaling

b) Scheduled Scaling

c) Dynamic Scaling

d) Predictive Scaling

❄Tasks:

Task 1:

Create a launch template with Amazon Linux 2 AMI and t2.micro instance type with Jenkins setup (You can use the Day 39 User data script for installing the required tools.

Step 1: Log in to AWS using the root or IAM users. (if you have permission to create EC2-instance as an IAM user)

Step 2: Go on EC2 Instances. Click on "Launch Templates".

Step 3: Give Name to Launch Template and Version.

Step 4: Select Image, and give all the info like private key and user-data script to install Jenkins in our system. Click on Launch Template.

Don't know about User Data Script.

Please go through this Article: AWS User-Data-Script

Congratulations!! Your first Launch Template was Created Successfully.

Step 5: Go to the Instance section and select Launch EC-Instance using Launch Template.

Select your Launch Template and Click on Launch Instances.

Instances Launched Successfully. Jenkins GUI is accessible.

Task 2:

Create 3 Instances using Launch Template, there must be an option that shows the number of instances to be launched, can you find it? :)

For Launching 3 Instances using the same template. Please Follow the same process as did in task 1 and only change the number of instances from 1 to 3.

Verify Instances Launch Successfully.

Task 3:

Create An Auto Scale Group using Launch Template which was created in Task1.

Step 1: Click on Auto Scaling Group and then click on Create Auto Scaling Group option.

Step 2: Give Autoscaling Group name and choose your Launch template.

Step 3: Select VPC and Availability Zone by default and Click on the next button.

Step 4: Verify your Auto Scaling Group Created Successfully.

In the Next Article, we will deep dive into AWS EC2 deep dive.....

Thank you for giving your precious time to read this blog/article and if any suggestions or improvements are required on my blogs feel free to connect on LinkedIn Unnati Gupta. Happy Learning !!!