I want to recover an Amazon Machine Image (AMI) that I accidentally deleted.
Short description
Unless you set up a Recycle Bin retention policy, it isn't possible to restore or recover a deleted or deregistered AMI. However, to create a new, identical AMI, use one of the following methods:
- Amazon Elastic Block Store (Amazon EBS) snapshots.
- Amazon Elastic Compute Cloud (Amazon EC2) instances launched from the deleted AMI.
Note: For security and privacy reasons, AWS Support doesn't have access to customer data. If you don't have backups of your deleted AMI, then AWS Support can't recover it. For more information about data security, see Shared responsibility model.
Resolution
Use the Recycle Bin
To save deleted AMIs for an established period, it's a best practice to set up a Recycle Bin retention policy. With Recycle Bin, you can restore AMIs that you accidentally deleted. For more information, see Recover deleted AMIs from the Recycle Bin.
Note: Recycle Bin protects resources only after you create a Recycle Bin retention policy. You can't use the Recycle Bin to restore AMIs that you deleted before you created the policy.
Restore the AMI from an Amazon EBS snapshot
When you delete or deregister an Amazon EBS-backed AMI, Amazon EBS keeps snapshots created for the instance volume during the AMI creation process. Use these snapshots to launch an identical AMI.
Restore the AMI from an EC2 instance
If both the AMI and the snapshots are deleted, then use an EC2 instance that you launched with the deleted AMI to recover the AMI. When you create an AMI from an instance, you automatically reboot the instance. To not reboot the instance, clear the Reboot instance option.
Note: This method creates an AMI of the current state of the instance that you used for the restore. This AMI isn't the initial AMI.
Related information
Recover deleted Amazon EBS snapshots and EBS-backed AMIs with Recycle Bin
How do I re-create a terminated Amazon EC2 instance?
How do I protect my data against accidental EC2 instance termination?