Nick Li
Nick Li

Reputation: 312

How to import EC2 snapshot from S3 backup? (AWS CLI import-snapshot)

I want examples on how to backup an EC2 snapshots to S3 bucket, and import it back afterwards.

I found the AWS CLI can export the snapshots to S3, and was explained here Copying aws snapshot to S3 bucket

I also found the import command from AWS CLI reference, but I failed to execute that command, as I don't follow understand the option https://docs.aws.amazon.com/cli/latest/reference/ec2/import-snapshot.html

can someone explain how to use this command? especially on how to specific which file on the S3 bucket to import from?

Upvotes: 0

Views: 1832

Answers (2)

Gaby Weiss
Gaby Weiss

Reputation: 136

If I am reading your question correctly, you are having trouble with choosing the bucket from which to restore your backup. You might find this easier using the EC2 console.

  • In the console - Navigation bar - select Snapshots

  • Select the snapshot you want to copy from the list

  • Choose Copy from Action list, complete the dialog box and click Copy

  • When the confirmation dialog box comes up if you click Snapshots then you can monitor the progress.

Here's some additional information on AWS backups that might help you.

Upvotes: 0

Shazic
Shazic

Reputation: 400

EC2 snapshots are by default stored on S3 standard storage. However, you cannot copy the snapshot to a specific S3 bucket using the AWS CLI.
There may be some third party tool out there somewhere that can do it, but I do not see any reason why you would need to download a snapshot to your s3 bucket? It's like paying for the snapshot twice!!!
Could you mention why you have this requirement? An easier alternate to your problem might exist.

Note: The two links that you shared in your question, do not copy a snapshot to S3. The first link shows how to copy a snapshot from one region to another, while the second link is to export a disk image into an EBS snapshot and only the following disk formats are supported for this import:

  • Virtual Hard Disk (VHD/VHDX)
  • ESX Virtual Machine Disk (VMDK)
  • Raw

Upvotes: 3

Related Questions