AWS has provided us with an automatic snapshot backup of EBS Volume and Instances using the data lifecycle manager. we have an AWS snapshot lifecycle policy that helps us to keep auto-backup of volumes by creating a policy.
How To Create Automatic Backup of Volumes And EC2 On Amazon cloud:
Find Volume Attach To Instances:
If you’re not sure which EBS volume attached to your EC2 instance,you find using the below path. EC2- > Select Server -> Descriptions -> find root/ Block Devices ID
Another way is to find the Volume attached is EBS -> volumes -> Select volume and look for the below path.
As you can see this volume attached to my running instances.
It’s better you give the proper tag to all instances, volumes, and all to identify them easily.
Configure Automatic snapshot Backup:
EC2 -> Elastic block storage -> Lifecycle Manager
Click on Create snapshot Lifecycle policy and I have given a description, the selected resource type is volume, and target tags mean you need to select the EBS volume and much more.
We can also schedule it for all EBS volumes in a single policy and finally tags them with a name.
The next part is to configure the policy schedule. I have given a name, schedule backup at every 4 hours means it will take 4 backups in a day and retain for 10 days means it will delete old snapshots for more than 10 days.
If you require to copy the snapshots to another region, you can enable it and there’re lots of options available you can choose them according to your need. Finally, click on Create policy.
You’re done.volume backup aws snapshot lifecycle policy