The Wayback Machine - https://web.archive.org/web/20240927181417/https://www.geeksforgeeks.org/amazon-web-services-creating-an-amazon-machine-imageami/
Open In App

Amazon Web Services – Creating an Amazon Machine Image(AMI)

Last Updated : 22 Nov, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In this tutorial, we’ll go through in great detail how to create an Amazon Machine Image on AWS. An operating system, programmes, and configuration settings are all part of an Amazon Machine Image (AMI), which is a template for software configuration. You must choose an AMI to act as the instance’s foundation when creating it in Amazon EC2. You can save time and guarantee consistency when launching numerous instances with the same configuration by building a custom AMI. A paused or operating Amazon EC2 instance can be used to build an Amazon Machine Image (AMI). If you’ve previously created an instance, proceed to the page where we started constructing an AMI; otherwise, carry on from here.

Steps To Create Amazon Machine Image(AMI)

Step 1: Access AWS Services by following Step 1 and logging in.

  • At the top left corner of your AWS account, click on the AWS Services tab and proceed to log in.
  • EC2 is what you need to click on if you’re looking for the Compute category.

AWS EC2 Instance

Step 2: Choose an AWS Region

Select the AWS Region in the top right corner of the EC2 dashboard to set up your EC2 server. Among numerous regions available across the globe, AWS enables you to opt one that best meets the needs of your apps with fast network response time and minimal downtime.

Select the Region

 

Step 3: Instance Launch

           1. On the EC2 dashboard, click the ‘Launch Instance’ button.
           2. The instance creation wizard will open, guiding you through the process of configuring your instance.

Launch Instance

 

Configure the instance details

 

Step 4: Choose an Amazon Machine Image (AMI)

Here we need to choose an AMI from the already available AMIs. Here we are choosing Amazon Linux Instance. You can select the appropriate AMI based on your application requirements. 

Select the AMI

 

Step 5: Choose EC2 Instance Types

Here I am selecting t2.micro(Free Tier Eligible) as the Instance type, you will select the type of instance that best suits your needs based on CPU, memory, and storage requirements.

Selec the Key pair

 

Step 6: Create and Download a Key Pair

Create a Key Pair if you don’t have one. Make sure to download the private key to use in future to launch an instance made using that key pair. Talking about key pair, it consists of a public key, which is stored on the instance, and a private key, which is used to securely connect to the instance.
   

Create a new key pair

 

Step 7: Configure Network Settings

In the network setting configuration, add number of Instances as 1, add the default VPC(or any other VPC if you have one) also the subnet connected to that vpc, then we will move on to create a security group which is the next step.

Configure the network

 

Step 8: Configure Security Groups

Specify the allowed protocols and IP addresses for the rules, whether it be by creating a new security group or utilizing an existing one. Our focus for the time being is on the default settings.

Firewall

 

Step 9: Add Storage

EBS volumes for your instances come in three types: General Purpose SSD, Magnetic, and Provisioned IOPS. They can be adjusted or added as necessary to suit your application’s IOPS requirements.

Comfigure storage

 

Step 10: Review and Launch Instance

Make sure to review the configuration settings and make any necessary adjustments before you launch your instance. Then, proceed by clicking “Launch” once you’re content with the setup or else you can also review commands.

launch instance

Creating an AMI from an Amazon EC2 Instance

You can create an Amazon Machine Image (AMI) from either a running or stopped Amazon EC2 instance. Here, we will outline the steps to create an AMI from an Amazon EC2 instance.

Step 1: Access the Amazon EC2 Instances View

First step towards creating an AMI is to navigate to the Amazon EC2 Instances console. Wondering how to go about it?
            1.Launching the AWS Management Console is where you should start.
            2.The next stop – the EC2 Dashboard, must not be missed.
            3.Navigating the instances in the instances view will lead you to the appropriate selection.

AWS Console

 

Step 2: Select the Instance for Your AMI

In the Amazon EC2 Instance­s view, you can locate the fundame­ntal instance for your AMI by using either the­ search box or                  filter options. Finding this instance is e­ssential for creating your AMI.Then choose Create Image from the context menu.

Select the Create Image

 

Step 3: Configure the Create Image Dialog Box

Give your new AMI a special name and description in the Create Image dialogue box. When you need to utilise the AMI later, this will make it easier for you to recognise it.By default, Amazon EC2 shuts down the instance, creates and registers the AMI, creates snapshots of any associated volumes, and reboots the instance. Choose the No reboot option if you don’t want your instance to be terminated during this  procedure.

Configure the Image details

 

Note :It is not assured that all file system changes will be included in the snapshot, hence selecting the No reboot option may  cause file system integrity problems with the produced image.To start the AMI creation process after configuring the options, click Create Image.

Create Image

 

Step 4: Monitor the AMI Creation Process

The process of creating an AMI could take a short while. Progress can be followed by:
          1. Using the AWS Explorer to access the AMIs view. Double-click the Amazon EC2 | AMIs node in the AWS Explorer to                            accomplish this.
          2. Select Owned By Me from the Viewing drop-down list in the AMIs view. All of the AMIs you have made will be seen in here.
          3. Look through the list for your just formed AMI.

Image summary

 

Step 5: Launch an Instance from Your New AMI

Once the­ Amazon Machine Image (AMI) is available, it can be­ used to launch new instances. Follow the­se steps to procee­d:   
One can acce­ss the Amazon EC2 dashboard by navigating to the AWS Manageme­nt Console. To view instances, simply  click on the­ “Instances” option located in the le­ft-hand menu. .
Then the use­r should click on the button labelled “Launch Instance­”. In this step, the­ user should select the­ My AMIs tab in order to access the list of the­ir previously created Amazon Machine­ Images (AMIs).The use­r needs to locate the­ newly created AMI and proce­ed by clicking on the Sele­ct button to use it as a foundation for  their new instance­.To launch the instance­, proceed with its launch process. Configure­ all necessary settings, such as type­, storage, security   groups and more as re­quired.

Launch instance

 

AMI

 

Launch the instance

 

Network settings

 

Instance launched

The Instance has been created successfully from your custom AMI.

Conclusion

When launching ne­w instances and deploying applications on the AWS cloud, cre­ating a custom Amazon Machine Image (AMI) can help simplify the­ process. Following the steps outline­d in this article will allow you to create an AMI customize­d with your desired software, se­ttings, and configurations, saving time and ensuring consistency. Manage­ your instances more easily with a custom AMI!
 



Similar Reads

What is Amazon Machine Image (AMI)?
An Amazon Machine Image is a special type of virtual appliance that is used to instantiate (create) a virtual machine within EC2. It serves as the basic unit of deployment for services delivered using EC2. Whenever you want to launch an instance, you need to specify AMI. To launch instances, you can also use different AMIs. If you want to launch mu
6 min read
Machine Learing (ML) Services Offered By Amazon Web Services (AWS)
In today's rapidly evolving technologies, harnessing the power of cloud computing has become imperative for businesses striving to stay ahead. Among the many cloud computing platforms, AWS is the most used cloud computing platform. In this guide, I will make sure that you will understand what is AWS and why cloud computing services are important to
10 min read
Amazon Web Services - Creating an Amazon Mechanical Turk Account
In this article, we are going to give you a run-through of how to go about signing up for an Amazon Mechanical Turk worker account, in order to get started working on tasks and earning money. To create the Mechanical Turk Account follow the below steps: Step 1: First, you'll need to access the Mechanical Turk website by going to mturk.com. This pag
2 min read
How To Create AMI using EC2?
Pre-requisite: EC2 EC2 is a cloud computing service made available by the Amazon Web Service. AWS is the paid platform for maintaining & using some online sources virtually. The Elastic Compute (EC) is a product inside of the AWS computer service. In simple words, AWS provides a completely virtual platform. There will be a virtual machine avail
8 min read
Difference Between A Snapshot And AMI In AWS
Snapshots and AMIs are the techniques used to create backups and templates to easily create copies of EBS. AMI has revolutionized cloud computing by encapsulating the configuration, underlying operating system, and software packages that are required to launch an instance in AWS. Snapshots, on the other hand, capture the state of volume and provide
5 min read
How To Create Custom AMI In AWS Using Terraform
In the present cloud-centric software development landscape, the capacity to efficiently manage infrastructure resources is vital. Making custom Amazon Machine Images (AMIs) is a pivotal part of this process, permitting organizations to normalize their application environments and streamline sending work processes. Terraform, an open-source infrast
7 min read
Amazon Web Services - Creating an AppSync GraphQL API
AppSync is an AWS service that helps you by simplifying the process of developing/building applications by letting developers create flexible, secure, extensible, and real-time APIs. It helps developers to manage and integrate mobile application data in real-time across devices and users, and at the same time allows the data to be accessed and modi
4 min read
Amazon Web Services - Creating a User Pool in AWS Cognito
A User pool in AWS Cognito is a user directory, which helps users to sign in to your web or mobile app through AWS Cognito. Users can also sign in through other social platforms like Google, Facebook, Amazon, or Apple. It doesn't matter users can directly sign in or use a third-party authentication, all these users in the User pool have a profile d
3 min read
Amazon Web Services - Creating a Lambda Function
Pre-Requisites: AWS AWS Lambda is one of the compute services that helps you to run code without provisioning or managing resources servers. With lambda, user can run their code on a high-availability computing infrastructure. Lambda performs all the tasks related to the administration of the compute resources, which includes the servers and operat
5 min read
Amazon Web Services - Copy an Amazon Redshift Cluster to Different AWS Account
In this article, we will look into how to copy an Amazon Redshift cluster from one account to a different account. Usually, users perform this operation from a production account to a quality account but you can use the steps to move a cluster from one account to another account in the same region. To do so follow the below steps: Step 1: In the ac
3 min read
Amazon Web Services - Configuring Amazon S3 Event Notifications
The Amazon S3 notification feature enables you to receive notifications when a certain event occurs inside your bucket. To get notifications, first, add a notification configuration that reads the event you want Amazon S3 to publish and the destinations where Amazon S3 will send the notifications. This configuration is stored in the notification su
5 min read
Amazon Web Services - Amazon S3 Notifications to SNS
In this article, we will see how the Amazon S3 bucket publishes notifications to SNS topics on object creation events. An object that creates an event is of four types. They are Put, Post, Copy, Multipart Upload, Remove, Replicate and Restore. Thus, whenever any of the event occur in our S3 bucket, it will publish a notification to a topic and the
3 min read
Amazon Web Services - Introduction to Amazon CloudWatch Synthetics
In this article, we will get an introduction to Amazon Cloudwatch Synthetics. With this feature, you can create different kinds of Canaries to continually verify your user experience even when you don't have traffic, monitor and test for unusual behavior, and trace issues to their source for faster resolution. Let's start by navigating to CloudWatc
3 min read
Amazon Web Services - Resolving Server Authorization Error in Amazon EKS API Server
In this article, we will look into how users who get the error you must be logged in to the server unauthorized when connecting to an Amazon Elastic Kubernetes Service API server. Here we have an Amazon EKS cluster that was created by a user initially. Only the creator of the Amazon EKS cluster has system masters permission to access and communicat
3 min read
Amazon Web Services - Upload Data to Amazon FinSpace
In this article, we will look into how you can upload data to Amazon FinSpace. Adding data to FinSpace is easy so long as you are a member of the group with the Create datasets permission. To do so follow the below steps: Step 1: From the home page choose ADD DATA. Step 2: Files can be simply dropped into the red box. Step 3: After dropping the fil
2 min read
Amazon Web Services - Introduction to Amazon FSx
In this article, we will look into Amazon's fully managed native File Server service called Amazon FSx, and it is integrated with the rest of AWS. So what does fully managed mean? It means that you no longer need to manage the hardware or the software to provide File server services to your users. AWS takes care of managing the hardware in terms of
5 min read
Amazon Web Services - Correctly Accessing CloudFront from Amazon S3
Sometimes users of Amazon Cloudfront get a 403 Access Denied error when using an Amazon S3 website endpoint as an origin in Amazon CloudFront distribution. So, in this article, we will work through resolving this error. To resolve the Access Denied Error follow the below steps: Step 1: After signing in to the AWS management console navigate to Amaz
2 min read
Amazon Web Services - Resolving Domain Pending Verification Status in Amazon SES
In this article, we are going to look into how to resolve pending verification for your domain in Amazon Simple Email Service(SES) by recreation. This procedure resolves the problem that occurs when the domain.txt record was initially defined incorrectly and then was correct after it later and as a result the verification status is still shown as p
2 min read
Amazon Web Services - Introduction to Amazon EKS
Amazon Elastic Kubernetes Service(EKS), is a fully managed service that you can use to run Kubernetes on Amazon Web Service. Kubernetes is open-source software that enables you to install and manage applications at a high scale. Its characteristics are: Availability: In order to ensure high availability Kubernetes executes and scales itself to vari
2 min read
Amazon Web Services - Auto Scaling Amazon EC2
Scalability refers to the capacity of a software solution to manage rising workloads. In simple terms, it is the ability of a system to readily add extra processing resources to handle the increased loads. Scaling Amazon EC2 means you start with the resources you require at the time of starting your service and build your architecture to automatica
13 min read
Amazon Web Services - Introduction to Amazon Aurora
A Cloud database is a database service fabricated and accessed through a cloud platform. It serves a considerable lot of indistinguishable functions as a conventional database with the additional adaptability of cloud computing. Users install the software on a cloud framework to implement the database. Amazon AuroraThe Amazon Aurora is a relational
6 min read
Amazon Web Services - Introduction to Amazon Lightsail
Amazon Light is an AWS service that provides the a gateway for simplified cloud hosting helping the AWS users. It act as a user-friendly cloud platform that is designed for easy hosting and management of virtual private servers (VPS). With the lightsail service users can quickly develop and manage the VPS instances with options for various operatin
9 min read
Amazon Web Services - Using Single SSH Key For all AWS Regions
Secure Shell also known as SSH is a cryptographic network protocol that helps secure network services over an unsecured network. It securely helps users to log in to a server with SSH than using a password alone. SSH keys are nearly impossible to decipher by brute force alone unlike passwords. In this article, we are going to look into how users ca
2 min read
Amazon Web Services - Target Network with a Client VPN Endpoint
In this article we are going to look into how you can associate a target network with an AWS Client VPN Endpoint. To do so follow the below steps: Step 1: After logging in to the AWS management console navigate to the Amazon Virtual Private Cloud(VPC) console. Step 2: In the navigation pane choose Client VPN endpoints and select the Client VPN endp
2 min read
Amazon Web Services - Introduction to Elastic Transcoder Service
Amazon Elastic Transcoder is a cloud-based media transcoding service. It is intended to be a highly scalable, simple-to-use, and cost-effective way for developers and organizations to convert their media files from their original format into versions that can be played on devices such as smartphones, tablets, and Computers. To be able to use the se
6 min read
Amazon Web Services - Data Pipelines
AWS is A Amazon Web Services, Inc. is A subordinate of Amazon which provides user cloud computing programs and APIs to independent companies, organizations,s, and government departments. This cloud computing web services provider provides several primary abstract technical infrastructure and appropriate computing building blocks and tools. This AWS
4 min read
Identity and Access Management (IAM) in Amazon Web Services (AWS)
Pre-requisite: AWS Identity and Access Management (IAM) manages Amazon Web Services (AWS) users and their access to AWS accounts and services. It controls the level of access a user can have over an AWS account & set users, grant permission, and allows a user to use different features of an AWS account. Identity and access management is mainly
5 min read
Amazon Web Services - Checking VPN Tunnel Status
In this article, we will look into what to check if traffic is not passing over your VPN. These steps are going to be different depending on whether you're using a static VPN or a BGP VPN. Follow the below steps to check the status of your VPN: Step 1: First thing you want to do is sign into your AWS console. Once you're on the service page scroll
2 min read
Amazon Web Services - Restricting S3 Access Only From CloudFront
In this article, we will look into how to restrict access to Simple Storage Service (S3) from CloudFront only. When developers are using S3 REST API endpoint as the origin to CloudFront, they can restrict access to S3 from CloudFront only by setting up the Origin Access Identity(OAI). This is a special CloudFront user, which they will associate wit
2 min read
Amazon Web Services - Deleting Network Load Balancer
The AWS Network Load Balancer is used for routing the connections to other active microservices, containers, or instances of Amazon EC2 from the Amazon Virtual Private Cloud(VPC). These mappings (connections) are based on the IP protocol data. It operates on the connection level (Layer 4), for both TCP and UDP connections. In this article, we will
3 min read