How To Restore A Backup Using AWS Backup Service

How To Restore A Backup Using AWS Backup Service

How To Restore A Backup Using AWS Backup Service

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In case of a disaster, having proper backup plan is not enough. You should also have the ability to recover from the disaster swiftly by restoring the backups in your disposal. In this blog post, we will discuss how to restore a backup using AWS backup service. We are going to first take a backup of an EC2 instance and then simulate a disaster by terminating the EC2 instance and finally recover from the disaster by restoring the backup of the EC2 instance. We will use AWS CLI for all the API actions in this demo.

How To Restore A Backup Using AWS Backup Service:

Prerequisites:

  • AWS CLI installed and configured with proper access. You can use below link to install and configure AWS CLI.
  • One running EC2 instance

https://cloudaffaire.com/how-to-install-aws-cli/

https://cloudaffaire.com/how-to-configure-aws-cli/

Step 1: Create an IAM role for AWS backup service.

Step 2: Create a backup of the running EC2 instance in your account.

Note: It may take some time to complete the backup job, proceed to next step when “State”: “COMPLETED” in the output of the above command.

Step 3: Get the recovery point ARN for the above EC2 instance backup.

Next, we will terminate the EC2 instance to simulate a disaster.

Step 4: Terminate the EC2 instance running in your account.

Next, we need to configure the restore metadata (In this case EC2 instance configuration). You can use the metadata section in the output of get-recovery-point-restore-metadata AWS CLI command to get the current instance metadata and edit this as per your requirement.

Step 5: Create a restore point metadata file used with the restore.

Note: Edit the above metadata as per your EC2 instance configuration obtained from get-recovery-point-restore-metadata command output.

Step 6: Restore the EC2 instance using the recovery point and restore metadata obtained in last step.

Note: It may take some time to complete the restore job, proceed to next step when “State”: “COMPLETED” in the output of the above command.

Step 7: Get the restore job details.

We have successfully restored the EC2 instance from the backup. You can now validate the Instance configuration my logging into your EC2 instance or from the console.

How To Restore An EC2 Instance Using Instance Backup

Next, we are going to delete all the resources created in this demo.

Step 8: Clean up.

Hope you have enjoyed this article. To know more about AWS Backup, please refer below official documentation

https://docs.aws.amazon.com/aws-backup/index.html

Leave a Reply

Close Menu