Backups in AWS

Shubham Thakur
6 min readMay 25, 2024

--

AWS Backup offers a centralized solution to secure your information. Create automated backup schedules, manage backups across services, and restore data with ease. Learn the key features and get started protecting your AWS resources in just minutes.

Gopher and Aws Backup

Even though cloud storage seems convenient and reliable, backing up your data to the cloud is surprisingly important. Cloud backups act as an extra layer of security for your information, protecting it from unexpected situations that can lead to data loss.

First lets talk about the feature of backup service provided by aws

Centralized backup management

AWS Backup provides a centralized backup console, a set of backup APIs, and the AWS Command Line Interface (AWS CLI) to manage backups across the AWS services that your applications use.

With Backup console you can maintain all your backups at a central hub.

aws backup console

Policy-based backup

With Policy based backups (or backup plan), You can automate the interval and frequency of backup. These plans can be customized to meet different needs and ensure all your resources are backed up according to your business requirements. This simplifies managing backups across your entire AWS environment.

backup plans

Tag-based backup policies

Tagging makes it easier to implement your backup strategy across all your applications and to ensure that all your AWS resources are backed up and protected.

Lifecycle management policies

Manage the lifecycle of your backups, and optimize the cost for your needs

Cross-Region backup

Store backups cross regions, for higher resilience in case of disaster.

Incremental backups

Backups can take long time, with incremental backups store only the changes in filesystem, optimizing cost and resources

Cross-account management and cross-account backup

With cross account management, in multi-account setup store your backup in central hub.

You can also copy backups to multiple different AWS accounts inside your AWS Organizations management structure. This way, you can “fan in” backups to a single repository account, then “fan out” backups for greater resilience.

Now lets create a backup policy and start backups on our aws account

Hands On

Before you start

  1. Sign in to the AWS Management Console, and open the AWS Backup console at https://console.aws.amazon.com/backup.
  2. Go to settings, on left pane, and ensure the backup is enabled

Simple On-Demand Backup

Lets start with simple and create an on-demand backup.

To create on-demand backup, Go to dashboard ( you can navigate using left pane on the page)

Now click on On-Demand backup. And fill out the form

  • Choose the resource you want to backup
  • Select backup window, I have selected backup now, but you can also customize by selecting a time window
  • Select the retention period. Retention period determines how long you want to keep your backup
  • Choose or create backup vault. (discussed in next section)
  • choose IAM role which will take backup, Note: This role should have permissions to take backup
  • Add tags to newly created backup (Optional)

Click on Create on-demand backup to create the backup

Depending on size of vm or resource it can take time for backup to be created. Meanwhile lets jump to next section

Backup Vault

Its storage for your backups. You can check it out from left pane, and clicking on backup vault

To create new backup vault, click on create backup vault.

Select a name for vault and encryption method.

Scheduled Backups

Creating manual backup is not practical when you want to backup after every interval, So in this section we discuss how you can backup your services with backup plan.

We can use existing templates or create new backup schedule

To create a backup plan from an existing one

  1. Sign in to the AWS Management Console, and open the AWS Backup console at https://console.aws.amazon.com/backup
  2. From the dashboard, choose Manage Backup plans. Or, using the navigation pane, choose Backup plans and choose Create Backup plan.

3. Choose Start with template, choose a plan from the list (for example, Daily-Monthly-1yr-Retention), and enter a name in the Backup plan name box.

4. On the plan summary page, choose the backup rule you want and then choose Edit.

5. Review and choose the values that you want for your rule (see Backup plan options and configuration for rule options).

6. For the backup vault, choose Default or choose Create new Backup vault to create a new vault.

7. (Optional)- choose an AWS Region from the list in Destination region to copy the backup to different Region. To add more Regions, choose Add copy.

Now you will be redirected to assign resources page

Choose a name for allocation

Choose resources you want to backup, you can select to backup all resources but its recommended to have different policies for each type of resource

If you choose include specific resource types, you can specify the resources to include or exclude

As final step choose tags to determine if the resource should be backed up

For example above config, will assign any ec2 resource with tags backup equal to yes and kubernetes not equal to my-k8s-machine to our plan.

Now click on assign resources.

And voila your resources will start getting backed up automatically if tags are present.

Few more things

  1. Backups will happen with jobs, you can check job status with job tab in left pane

2. You can enable automatic backup for efs, by going to efs resource -> edit -> general -> enable automatic backups

3. Optionally you can add alerts on the backups creation policy and job

To Restore

Open the AWS Backup console at https://console.aws.amazon.com/backup

  • In the navigation pane, choose Protected resources and the resource ID you want to restore.
  • A list of your recovery points, including the resource type, is displayed by Resource ID. Choose a resource to open the Resource details page.
  • To restore a resource, in the Backups pane, choose the radio button next to the recovery point ID of the resource. In the upper-right corner of the pane, choose Restore.
  • Specify the restore parameters. The restore parameters shown are specific to the resource type that is selected.

Conclusion

In this article we learned how to backup and restore aws resources. We also learned how you can automate this process.

Official Docs:

https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html

Hope you liked the article, If there are any suggestions or mistakes i have made please let me know.

--

--