The Power of AWS AMI: Streamlining EC2 Instance Launches

The Power of AWS AMI: Streamlining EC2 Instance Launches

First, let’s start with a brief overview of what an AWS AMI is. An AMI (Amazon Machine Image) is essentially a pre-configured virtual machine that you can use as a template to launch EC2 (Elastic Compute Cloud) instances. AMIs can contain an operating system, application server, and pre-installed applications that you can use to quickly and easily launch an EC2 instance.

AMIs are built for a specific region and can be copied across regions. You can Launch EC2 instances from different kinds of AMIs.

  • A public AMI: AWS provided (Amazon Linux 2 AMI)
  • Your own AMI: you make and maintain them yourself
  • An AWS Marketplace AMI: an AMI someone else made (and potentially sells)

And even you as a user could create a business of selling AMIs on the AWS marketplace.

Some benefits of using AWS AMI include:

  1. Faster deployment: Since AMIs contain pre-configured settings and software, it is much faster to launch an EC2 instance from an AMI than to configure it manually.
  2. Consistent environment: Using the same AMI to launch multiple EC2 instances ensures that all instances have the same software and configurations.
  3. Cost-effective: Since AMIs can be created from EC2 instances, you can save money by creating an AMI and launching multiple instances from it instead of creating multiple instances from scratch.

AMI Process (From an EC2 instance)

  • Start an EC2 instance and customize it
  • Stop the instance( for data integrity)
  • Build an AMI — this will also create EBS snapshots
  • Launch instances from other AMIs

So we have US-EAST-1C, and we can create the same instance in US-EAST-1B, so the process is we lunch the instance in US-EAST-1A, we are going to customize it then we are going to create an AMI from it, which is in the middle of the diagram and then in US-EAST-1B we will be able to lunch from that AMI and we will effectively create a copy of our EC2 instance.

AMI Hands-on

So First we will start with launching the EC2 instance in US-EAST-1C. and then we will install Jenkins in the EC2 instance.

I have already launched the EC2 instance and installed Jenkins in it.

  1. Follow the below link to install Jenkins in EC2 instance.

[How to install Jenkins in Windows Machine and in AWS EC2 Instance
1. Windows installation guidemedium.com](https://medium.com/@U_N_R_3_A_L/how-to-install-jenkins-in-windows-machine-and-in-aws-ec2-instance-2ddf49ad3122 "medium.com/@U_N_R_3_A_L/how-to-install-jenk..")

2. Select the instance and Action-> Image and templates -> Create Image

3. Enter the name of the Image and Create Image

It will take some time to create AMI from the EC2 instance. Check the status of AMI if it is available then it is ready to use. Once it is available go to the EC2 instance and Lunch the instance.

4. Select the Custom AMI while launching the Instance. My AMIs-> Owned by me and Select the one you created.

The rest configuration will be the same as you used for the first instance and lunch the instance.

5. Copy the Public IP of the instance and Paste it into the browser(Make sure to add Port 8080)

Congratulations!!⭐️ With the help of AMI, we can directly use Jenkins in our newly created EC2 instance. This is the whole power of AMIs⚡️

In conclusion, AWS AMI is a powerful tool for deploying and managing EC2 instances. It enables you to quickly and easily launch instances with pre-configured software and configurations, saving you time and money. With proper security and maintenance, AWS AMI can be an essential component of your cloud infrastructure.

Thank you for reading the blog, If you found this blog helpful then follow and hit the clap👏 button to show your support 🌳