Creating, Sharing and Retiring AMIs
This lesson explains Amazon Machine Images (AMIs), the templates from which EC2 instances launch, and how golden AMIs with hardened, patched software make launches fast and consistent.
Learning outcomes
After completing this lesson, you will be able to:
- Describe what an AMI contains.
- Copy and share AMIs, including encrypted ones.
- Retire AMIs safely with deprecation and disabling.
What an AMI contains
An EBS-backed AMI consists of one or more EBS snapshots (root and data volumes), launch permissions that control which accounts can use it, and a block device mapping that describes the volumes to create. AMIs are Regional: an AMI ID exists in one Region only. Creating an AMI from an instance (create-image) reboots the instance by default to ensure file system consistency; the --no-reboot option avoids downtime but risks an inconsistent image of running applications. AMIs can also be created from snapshots, built by Image Builder, or imported from virtual machine images with VM Import.
Copying and sharing
copy-image copies an AMI and its snapshots to another Region (or within a Region), producing a new AMI ID, and can encrypt unencrypted snapshots or re-encrypt with a different KMS key in the destination. AMIs are shared by adding launch permissions for specific accounts, OUs or the whole organisation; making AMIs public is blocked by default by block public access for AMIs. Sharing an AMI encrypted with a customer managed key also requires the key policy (or a grant) to allow the target account to use the key; AMIs encrypted with the AWS managed aws/ebs key cannot be shared, so they must first be copied with a customer managed key. Consumers often copy shared AMIs into their own account so they are not affected if the owner deregisters them.
aws ec2 copy-image --source-region eu-west-1 --source-image-id ami-0abc --region us-west-2 \
--name web-golden-2026-10 --encrypted --kms-key-id alias/dr-ebs
aws ec2 modify-image-attribute --image-id ami-0def \
--launch-permission "Add=[{OrganizationalUnitArn=arn:aws:organizations::111122223333:ou/o-abc/ou-prod}]"The following diagram shows an AMI copied with a customer managed key and shared.

Sharing AMIs
Retiring AMIs safely
AMIs move through a controlled retirement. Deprecation sets a date after which the AMI no longer appears in default searches, though it can still be launched by ID. Disabling an AMI prevents new launches while keeping it for audit; it can be re-enabled. Deregistration removes the AMI, but its snapshots remain and continue to incur charges until deleted. Deregistration protection prevents accidental deregistration, and a Recycle Bin rule for AMIs allows recovery after deregistration. Running instances are unaffected by any of these actions.
| Action | New launches | Reversible | Snapshots |
|---|---|---|---|
| Deprecate | Allowed by ID; hidden from searches | Yes | Kept |
| Disable | Blocked | Yes (re-enable) | Kept (can be archived) |
| Deregister | Impossible | Only via Recycle Bin | Kept until deleted |
Retiring an AMI
Sharing a golden image across the organisation
A platform team builds encrypted golden AMIs in a central account and must make them usable in every production account. Because the images are encrypted with the default aws/ebs key, sharing fails. The team creates a customer managed key whose policy allows the organisation's principals to use it for EC2 through kms:ViaService and aws:PrincipalOrgID conditions, copies the AMI with that key, and shares it with the Prod OU. Auto Scaling groups in the production accounts also need the service-linked role to be able to use the key, which the organisation-wide key policy covers.
Can an AMI be launched directly in another Region?
Show answer
No. AMIs are Regional, so it must first be copied to that Region.
Exam Tips
Remember for the exam
- AMIs are Regional; copy them to use them in another Region.
- Share encrypted AMIs only with a customer managed key that the target account can use.
- CreateImage reboots by default; --no-reboot risks inconsistency.
- Deregistering an AMI does not delete its snapshots.
- Deprecate hides, disable blocks launches, deregister removes.