100 Days of AWS — Day 18- Automate the EBS Snapshot and AMIs creation using Amazon Data Lifecycle Manager

  • Snapshots are a point in time backups of modified EBS Volumes stored in S3.
  • They are incremental, i.e., the first snapshot is the complete backup of your Volume, but all the subsequent snapshot is just an incremental change.
  • We can use snapshots to create an AMI.
  • Mostly used for a backup purpose to fully restore your EBS Volumes.
  • The recommendation is to frequently take snapshots depending upon your Recovery Time Objective(RTO)
  • For data consistency, it’s good to stop any write operation before performing snapshots.

Data Life Cycle Manager

  • You can define policies to enforce backup on regular schedule.
  • Use of tag to identify volumes and instance defined in the policies
  • Manage cost by deleting snapshots
  • In the next screen, you have an option to take snapshot of specific Volume by specifying the tag or at instance level which will take snapshot of all the EBS volumes associated with the instance(In the bottom you have an option to exclude root volume)(don’t Forget to click on Add). Give your policy description and select the Default role. Make sure policy status is Enabled. Click on Next.
  • In the next screen give your Schedule name, you can select the Frequency(Daily, Weekly, Monthly, Yearly or Custom cron expression). You can schedule this snapshot every (1,2,3,4,6,8,12,24 hour). Specify the starting time(NOTE timing is in UTC, so please adjust it based on the requirement as you don’t want your snapshot to be happen during Production hour). Last you can specify how many copies of snapshot you want to maintain. Copy tags from source check this option so that snapshot will have same tag as your instance tag. In the next screen, click on Create policy.
  • Now if you go to the EC2 console and click on Snapshots, you will see the snapshots created by the policy.
  • Automating the process of AMI creation is similar to EBS Snapshot. For AMI creation from the drop-down choose EBS-backed AMI policy.
  • The first few steps is similar to snapshot creation, select the Target resource tags, give your policy name, make sure policy status is enabled. Choose Instance reboot as no
  • Define the schedule, similar to we defined for Snapshot creation, review the policy and create it.
  • It also provides monitoring via CloudWatch for your policy.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store