Launching Amazon EC2 Instance with Amazon Machine Images (AMI)

  • Post category:Solutions
  • Reading time:4 mins read

Creating an Amazon Machine Image (AMI) for your product is a great way to simplify your computing infrastructure. A developer simply launches their software on the AMI along with some configuration variables, and their product is up and running on EC2 Instance. With an AMI, you don’t have to build machine images from scratch every time; instead, you start with a pre-built software stack and customize it for your specific needs.

In this post, we will show you how to launch a new instance from an AMI along with some Jenkins configuration variables. Those configuration variables will be used in the next steps to create a customized Amazon Machine Image (AMI) that can then be reused to launch new instances with the same configuration.

What is Elastic Cloud Compute (EC2) Instance?

Elastic-cloud-computing allows users with minimal technical knowledge access large amounts of disk space without having an expensive deal for years worth of upfront fees like traditional hosting providers do. You just pay monthly based on what your usage will typically go through each calendar year; if it doesn’t exceed this limit then there’s no extra charge!

ec2 instances

  • For launching EC2  instance service, click on the Services drop-down menu as shown in the below figure.

ec2 instance

  • Select EC2 from Compute and you will see the EC2 Dashboard which is shown below.

ec2 instances pricing

  • On the left-hand side of the dashboard, you will see Instances click on that.

ec2 instance storage

  • After that click on Launch instances.

ec2 instance limit

  • Now we have to choose Amazon Machine Image (AMI).
  • An Amazon Machine Image (AMI) provides the information required to launch an instance, which is a virtual server in the cloud.
  • Select the Amazon Linux 2 AMI because it is Free tier eligible and you will not occur any charges on your AWS account.

ec2 instances

  • Now we have to select the instance type. So by default t2.micro is selected and we will go with that because that comes under the free tier.

ec2 instance

  • Click on Next: Configure Instance Details.
  • Here you do not need to do anything just leave all the settings as it is and again Click on Next: Add Storage.
  • In this step also there is no need to Add Storage and click on Next: Add Tags.
  • Here we are adding tags. Tagging means giving it a name. So click on Add tag.

ec2 instances pricing

  • Now we will give it a name as shown below.

ec2 instance storage

  • Click on Next: Configure Security group
  • Here we will create a new Security Group name as EC2-SG and keep the description as same and then click on Add rule, from the list select HTTP and select the sources as Anywhere for both SSH and HTTP
  • Click on Review and Launch

ec2 instance limit

  • After Reviewing click on Launch
  • Now you will be asked to create a new key pair or an existing key pair
  • Here we will create a new key pair. So click on create a new key pair and give it a name as EC2-key and then click on Download key pair
  • After clicking on the Download key pair click on Launch instances

ec2 instances

NOTE: Don’t forget to download the key pair because once the instance is launched you will not be able to download it.

  • Click on View Instances

ec2 instance

  • Now it will show that the instance is in the pending state but wait for a few seconds and you will see that the instance is in a running state.

ec2 instances pricing

  • Click on that check box which is beside of instance name and you will see all the Details, Security, Networking, and configurations that you have done while creating an instance

ec2 instance storage

  • This is the complete overview of how to launch an EC2 instance.

Conclusion:

AWS EC2 instances are virtual servers that let you run your own operating system and software on the cloud. They operate like physical machines, but because they’re not real hardware, you can configure them to be as big or small as you want with no upfront investment cost. You just need a credit card for processing fees and an internet connection! Plus, there is no equipment to maintain – all of the maintenance tasks will be taken care of by Amazon Web Services (AWS). If this sounds appealing and you’re ready to get started building your very own instance today!

To learn more on cloud computing check our other blogs.

Happy cloud computing!!

Leave a Reply