An Amazon Machine Image (AMI) is a pre-configured template that contains the operating system, application server, and applications required to launch an EC2 instance, serving as the foundational building block for creating virtual servers in AWS.
An Amazon Machine Image (AMI) is a pre-configured template that provides the information required to launch an EC2 instance. It includes the operating system, application server, and applications, along with the mapping for attached block devices (EBS volumes or instance store). AMIs can be sourced from AWS (Quick Start AMIs), the AWS Marketplace (pre-packaged software), community-contributed, or custom-created from existing instances. This flexibility allows users to quickly deploy standardized environments, replicate production setups, and share golden images across teams or accounts.
Quick Start AMIs: Provided by AWS (e.g., Amazon Linux 2, Windows Server) with regular security updates, no additional charge beyond usage
AWS Marketplace AMIs: Pre-packaged software from third-party vendors (e.g., WordPress, Jenkins) often with hourly license fees
Community AMIs: Shared by other AWS users; use with caution as they may not be secure or updated
Custom AMIs: Created from a running EC2 instance using create-image; ideal for golden images, disaster recovery, and consistent deployments
Copyable AMIs: AMIs can be copied across regions and accounts, enabling global deployment and shared golden images
Create AMI from running instance: Use aws ec2 create-image to capture the exact state of an instance, including data from attached EBS volumes
Deregister AMI: Removes the AMI from your account, but does not delete the underlying EBS snapshots automatically; manage snapshots separately
Deprecation Time: Set a deprecation time for old AMIs to warn or prevent usage after a certain date
Cross-account Sharing: Use modify-image-attribute to share AMIs with specific AWS accounts, ideal for multi-account CI/CD pipelines
Encryption: AMIs created from encrypted volumes automatically support encryption at rest; use AWS KMS keys for control
Cost: You pay for EBS snapshots backing the AMI; cleaning up unused AMIs and snapshots reduces costs