AWS Data Lifecycle Manager: A Quick way to automate AMI and Snapshot Management
AWS provides a quick and easy way to maintain your backups through AMIs and Snapshots. You can manually create AMIs and Snapshots of your EC2 Instance or you can automate this procedure for your ease. Automating the procedure lifts off the responsibility to generate updated AMIs and Snapshots. You can set retention policies and nominate your specified region for backup as well. This article will focus on discussing the AWS Data Lifecycle Management Policy. I will share the Best Practices as per my opinion and experience.
Snapshots are a point in time backup of your data stored on your EBS Storage Volumes.
- Data on Boot drives and Block storage volumes are also preserved using these snapshots.
- Snapshots can be created for EBS Volumes that may or may not be attached to an instance.
- EBS Snapshots serve the purpose of disaster recovery and data or system migration across regions or accounts.
Amazon Machine Image (AMI)
AMI is a combination of
- AMI serves as a backup solution to store a specific state of system configurations with respect to the time at which the AMI was created.
- AMI consists of the following units:
- System configurations stored on the Boot volume.
- One or more EBS Volume Snapshots containing data stored in Original System’s drives.
- A block device mapping that acts as a guide to attach volumes when the instance is launched.
- Launch permissions specify who can use the AMI to launch instances.
Data Life Cycle Manager
Data Lifecycle Policy provides two types of backup solutions:
- EBS Snapshots.
- EBS backed AMIs.
Data Lifecycle Manager helps you to:
- Create EBS Snapshots and AMIs.
- Retain them for a calculated period of time.
- After the retention period expires automatically decommissions the Snapshots and AMIs created by Data Lifecycle Policy.
Benefits of DLM Policy
DLM Policy acts as a primary unit of the Disaster Recovery System. The EBS Snapshots and EBS backed AMIs created by DLM Policy act as a constant backup generating system. It offers the following great benefits:
- Automated backup generating service runs on its own schedule.
- Cross-region backup generation to ensure data protection.
- A retention policy is part of the DLM Policy that defines when a Snapshot or AMI is going to be deleted. Retention policy takes away the hassle of manually deleting obsolete Snapshots and AMIs. Retention Policy involves to units:
- Count of Snapshots/AMIs created. This number can range between (1 to 1000).
- Age of Snapshots/AMIs created.
Types of Lifecycle Policy
- EBS Snapshot Policy: Creates snapshots of EBS Volumes.
- EBS backed AMI Policy: Creates EBS backed AMIs of specified Instances.
- Cross-Account copy Event Policy: Automatically copies shared snapshots across accounts.
How to set up DLM Policy?
- Go to the console space of EC2 Service.
- Find Lifecycle Manager under Elastic Block Store options in the left pane.
- Choose your Lifecycle policy option. There are two types of policy options available that include EBS Snapshot Policy, EBS backed AMI Policy and Cross-Account Copy Event Policy.
- Specify the Target group for your policy either Volumes or Instances.
- Configure the schedule for your policy. This portion includes configurations regarding the time when Snapshots/AMIs will be created, retention period and if you want to export them to other regions.
- Once the policy is live your policy will work on its own. Among your own AMIs you can differentiate on the bases of Tags that are attached with Snapshots/AMIs.