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 multiple instances from a single AMI, then you need multiple instances of the same configuration.
Properties of AMI
- A template for the root volume for the instance (for example, an operating system, an application server, and applications)
- Launch permissions that control which AWS accounts can use the AMI to launch instances.
- A block device mapping that specifies the volumes to attach to the instance when it’s launched
When you want to use AMI, select the following characteristics:-
- Permission for launching AMI
- Operating System
- Root device Storage
Use an AMI
You can create your own customized AMI from an existing ec2-instance with the help of snapshots. After creating a snapshot you create a new ec2-instance by using the existing one know the new instance is the copy of an existing instance with all the required data in it. You can search for an AMI that meets the criteria for your new instance and you can use that instance to create a new instance as shown in the following figure.
Why do We Need AMI?
Let us suppose that we want to launch 5 servers with the same configuration. One way of doing that would be to launch a new EC2 instance every time and install the required packages every time. While the other way of doing it would be to configure your EC2 instance once and then create an image of that instance. Using that image you can deploy four more EC2 servers.
Steps To Create your own AMI
Step 1: Click on the launch instance button on the AWS management console.
Step 2: Now you will be asked to select an already available AMI. Select the Free tier and then select the Amazon Linux 2 AMI.
Step 3: Select t2.micro eligible (Instance types in aws) for the free tier. Now click on next: configure Instance details.
Step 4: Here you can select the various configurations related to the EC2 instance. Click on Next: Add storage.
Step 5: Select the amount of storage you want for the EC2 instance. Click on Next: Add tags and then click Next: configure security groups.
Step 6: Here you can add the security groups to allow the desired traffic for your instance. Click on review and launch.
Step 7: Review all the configurations regarding the EC2 instance. Click on Launch.
Step 8: Choose to create a new key pair option and write the key pair name. Download the key pair and then click on the launch instance.
Step 9: We can see that the instance is launched and running in a healthy state. Now It is required to create the Amazon Machine Image of this instance.
Step 10: Click on actions. Go to the image and then click on create an image.
Step 11: A prompt will open wherein you are required to write the name of the image. Click on create an image.
Step 12: The image creation request is received. Now the image will be created. Click on close. Now go to AMI services in the AWS management console.
Step 13: The AMI image of our instance is created successfully.
The AMIs are mainly divided into four types as mentioned below:
- Amazon-provided AMIs.
- Marketplace AMIs.
- Community AMIs.
- Custom AMIs.
Buy, share, and sell AMIs
If you created a customized AMI according to your needs for the organization if it is highly confidential you can keep that AMI in private or if it can be shared with the public you can keep it in the community so others can use it.
Instead of you creating customized AMIs for your organization you save effort forth and time by using the AMIs which are created by third-party organizations such as Red Hat, and Ubuntu. You can create your own customized AMI and sell it to other Amazon EC2 users depending on their need.
Pricing Of AMI
- The pricing of the AMI depends upon the type of AMI you are going to use if you are going to use a public AMI then it is free of cost if you want to use a private AMI you have to pay to use it.
- You will be charged upon the region where you are going to store your AMI. If you stored your AMI in US-region then the pricing will be different and if you stored your AMI in Asia Pacific then the pricing will be different.
- You will be charged based on the bandwidth like the data you’re transferred in and out and the region you stored it.
- If your going to the private AMI you will be charged based upon the amount set by the seller.
- The storage charges for private AMIs are more when compared with public AMIs.
Types of EC2-Instances
There are different types of EC2-Instances types which are defined for certain use cases and unique requirements for different workloads and different applications depending on your use cases like depending on the computing, memory, or storage you required. for more read Amazon EC2 – Instance Types
Advantages Of Amazon EC2
- Highly scalable: Amazon ec-2 instance will allow you to scale your infrastructure very easily and highly. You can increase and decrease the memory and CPU whenever you required depending upon the traffic.
- Highly available: Amazon ec2-instance is highly available because you can configure it multiple availability zones and if there is a failure in one zone you can automatically access the infrastructure which is available in another zone.
- Integration: You can integrate ec2-instance with multiple aws resources which are available in AWS such as S3, Autoscaling group, Load Balancing, RDS, and so on.
- EC2-Instance is secure: Ec2-instance is more secure because it can be integrated with VPC (virtual private cloud). ec2 can be configured in multiple private subnets where it is very hard to penetrate into it.
- Global Infrastructure: Amazon ec2-instance is available in multiple regions and multiple zones by which you can deploy your applications near to your users which will decrease the latency and improves the performance of the application.
FAQs On Amzon Machine Image (AMI)
1. What is an AMI stands for?
AMI stands for Amazon Machine Image.
2. What is the difference between AMI and EC2?
AMI is used to create EC2-Instances and EC2-Instance are used to create the virtual machines.
Share your thoughts in the comments
Please Login to comment...