In the last tutorial we created lots of EC2 instances for auto scaling but what if we want our EC2 instances configured already before adding them to our ASG. This is where AMI comes in an AMI stands for Amazon Machine Image. It allows you to customize your EC2 instance. With an AMI you can add your on configured software, config, monitoring and operating system.
If you create your own AMI then AWS saves all the configurations and software in an EBS snapshot in such a way that it can start an EC2 instance can be configured from that AMI. After that we can launch our EC2 instances from these AMI. These are available to use in a region and can be copied across regions to take advantage of global presence of AWS.
We were already using AMI from the first time we created an EC2 instance. Where we selected Amazon Linux 2 AMI in the second step while creating an EC2 instance. These are three types of AMI available on AWS.
- Public AMI provided by AWS
- Marketplace AMI which we saw in the second part of this series where AMI with preconfigured software.
- Private AMI: AMI which we build and maintain ourselves.
So you can see AMI are very powerful we can get preconfigured EC2 instances from it. Which can be put behind a load balancer and an ASG to get a group of preconfigured servers where we can deploy our apps. Next up we will do a Hands on how to create an AMI.