Amazon EC2 AMI Lifecycle (Part 1)
Introduction
An Amazon Machine Image
(AMI) is an image that includes the necessary software setup to initialize and
run an instance. When launching an instance, you need to select an AMI. You
have the option to utilize AMIs offered by Amazon or to create your own. The
AMI has to be in the AWS Region where you plan to launch your instance.
The lifecycle of an AMI
includes creating, copying, deprecating, disabling, and deleting
(deregistering) the AMI.
Create AMIs
Although
Amazon offers AMIs for launching your instances, you have the option to develop
custom AMIs that suit your specific requirements. To create a personalized AMI,
start by launching an instance from a pre-existing AMI, make your
customizations to the instance (such as installing software and adjusting
operating system settings), and then generate an AMI from that instance. All
customizations made to the instance will be preserved in the new AMI, ensuring
that any instances launched from it will incorporate those modifications.
Copy AMIs
An
AMI can only be used to launch an instance in the specific AWS Region where it
resides. If you want to launch instances with identical configurations across
different Regions, you will need to copy the AMI to those other Regions.
Deprecate AMIs
To
designate an AMI as outdated or superseded, you have the option to specify a
deprecation date that is either immediate or set for a future time. While
deprecated AMIs will not appear in AMI listings, they can still be utilized by
users and services if they are aware of the AMI ID.
Disable AMIs
To
temporarily stop an AMI from being utilized, you have the option to disable it.
When an AMI is disabled, it cannot be used to launch new instances. However, if
you choose to re-enable the AMI, it can once again be employed to launch
instances. Keep in mind that disabling an AMI does not impact any existing
instances that were already launched from it.
Deregister (delete) AMIs
When
an AMI is no longer necessary, you can deregister it to stop it from being used
for launching new instances. If the AMI complies with a retention rule, it is
sent to the Recycle Bin, where it can be restored prior to the expiration of
its retention period; otherwise, it will be permanently deleted. If it fails to
meet a retention rule, it will be permanently deleted right away. Keep in mind
that deregistering an AMI does not impact any existing instances that were
created from that AMI.
Automate the AMI lifecycle
Amazon Data Lifecycle Manager allows you
to automate the creation, retention, copying, deprecation, and deregistration
of Amazon EBS-backed AMIs along with their associated snapshots. Additionally,
EC2 Image Builder can be utilized to automate the creation, management, and
deployment of tailored AMIs.
Comments
Post a Comment