How can I recover an accidentally deleted AMI?

2 minute read
0

I want to recover an Amazon Machine Image (AMI) that I accidentally deleted.

Short description

It isn't possible to restore or recover a deleted or deregistered AMI. However, you can create a new, identical AMI using one of the following:

  • Amazon Elastic Block Store (Amazon EBS) snapshots that were created as backups.
  • Amazon Elastic Compute Cloud (Amazon EC2) instances that were launched from the deleted AMI.

Note: For security and privacy reasons, AWS Support doesn't have visibility or access to customer data. If you don't have backups of your deleted AMI, then AWS Support can't recover it for you. For more information on the security of customer data, see Shared responsibility model.

Resolution

Restore the AMI from an EBS snapshot

When you delete or deregister an Amazon EBS-backed AMI, any snapshots created for the volume of the instance during the AMI creation process are retained. If you accidentally delete the AMI, then you can launch an identical AMI using one of the retained snapshots.

For instructions on how to create an AMI from a snapshot, see Creating a Linux AMI from a snapshot.

Restore the AMI from an EC2 instance

If both the AMI and the snapshots are deleted, then you can recover the AMI from any EC2 instance that you launched using the deleted AMI.

Note: Unless you selected the No reboot option on the instance, performing the following procedure reboots the instance. For more information on the No reboot option, see step 6 in Creating a Linux AMI from an instance.

  1. Open the Amazon EC2 console.
  2. Choose Instances, and then select the instance that you want to use to create the AMI.
  3. Select Actions, Image, Create Image.

Note: This method creates an AMI of the current state of the instance being used for the restore, not the initial AMI.

For more information on how to create an AMI from an instance, see Creating a Linux AMI from an instance.

Related information

How do I re-create a terminated EC2 instance?

How do I protect my data against accidental EC2 instance termination?

AWS OFFICIAL
AWS OFFICIALUpdated 10 months ago