Use AWS EC2 Lifecycle Manager to back up EBS volumes via EBS snapshots, every 7 days, and keep only 4.
We're looking to create something robust, automated, and AWS-native.
Step 0 - Prerequisites
- Your EC2 instance uses EBS volumes.
- Volumes are tagged (we’ll use this to target them).
- You have necessary IAM permissions to manage DLM.
Step 1: Tag Your Volume
- Go to
EC2 → Volumes
- Find the EBS volume you want to back up (likely the one attached to your EC2 running Docker).
- Add a tag:
Key: Backup
Value: True
Step 2: Create Lifecycle Policy
- Go to EC2 → Lifecycle Manager (or search “Lifecycle Manager” in AWS Console).
- Click Create Lifecycle Policy.
- Policy type: EBS Snapshot Policy.
Step 3: Configure Policy
Target Resources
- Target resource types: Volume
- Resource tags:
Key: Backup
Value: True
Schedule
- Name: WeeklyBackup
- Frequency: 7 days
- Start time: Pick a low-traffic time (e.g. 2:00 AM UTC)
- Retention type: Count
- Retain: 4 snapshots
Subscribe to new posts
Processing your application
Please check your inbox and click the link to confirm your subscription
There was an error sending the email