How do I re-create a terminated EC2 instance?
Last updated: 2021-02-01
My Amazon Elastic Compute Cloud (Amazon EC2) instance was terminated, but I want to recover or restore data from that instance. Can I re-create a terminated EC2 instance?
As part of an Amazon EC2 instance termination, the data on any instance store volumes associated with that instance is deleted. By default, the root Amazon Elastic Block Store (Amazon EBS) volume is automatically deleted.
It's not possible to recover either the original Amazon EC2 instance or any volumes that were deleted as part of the termination process. However, there are two methods for re-creating the terminated instance:
- Launch a replacement Amazon EC2 instance using Amazon EBS snapshots or Amazon Machine Images (AMI) backups that were created from the terminated Amazon EC2 instance.
- Attach an Amazon EBS volume from the terminated instance to another Amazon EC2 instance. You can then access the data contained in those volumes.
In addition to regularly taking snapshots and AMIs to back up critical data, consider using termination protection to help prevent this issue in the future. You can also automate snapshots with Amazon Data Lifecycle Manager (Amazon DLM) and AWS Backup.