AMIs (Amazon Machine Images) are containers that are used to build instances (OS + SW packages + settings).
- Snapshots of EBS volumes are created automatically and used to create an AMI.
- AMI stores a snapshot of EBS volumes, permissions, and a block device mapping.
- AMIs need to have appropriate launch permissions (private, a specific account, or public).
- AMIs can be copied to other AWS regions.
- AMI is used with Auto Scaling to launch new servers on demand.
- AMIs are only available in the region they are created.
- You can select the AMI based on: Region, OS, Architecture (32, 64, Arm), Launch Permissions, Root Storage Types (EBS or Instance store volume).
- EBS is from the snapshot, and an Instance store volume is from the template.
Types of AMIs
- Community AMIs (free)
- AWS Market AMIs (pay to use + additional licensed software)
- My AMIs
EC2 Image Builder
EC2 Image builder allows you to create AMIs and container images simply through a graphical interface.
- It validates and tests images.
- Security compliance, AWS-provided tests, or custom tests
- Use case:
- You can automate image update processes such as software updates. Image Builder creates a new image, runs validation tests, and makes it available in AWS regions of your choice.
- Image Recipe:
- Image builder uses a recipe for each image.
- An image can be AMI (Amazon Machine Image) or Docker Image.
- A pipeline defines the configuration and end-to-end process.
- Base OS (Source Image) -> Software (Build Components) -> Tests -> Distribution
How to use Image Builder
- Create an IAM Role: add permissions for EC2 Image Builder
- Create an Image Pipeline: define a recipe – configuration settings
- Execute the Pipeline: Image Builder launches a temporary build and tests the instance.
- The image can be seen in the EC2 console AMIs section.