EBS Snapshots, Encryption, and RAID
Create and automate EBS snapshots for point-in-time backups, encrypt volumes with KMS, and understand RAID 0 vs RAID 1 on EC2.
EBS Snapshots: Point-in-Time Backups
EBS snapshots are point-in-time backups of EBS volumes stored durably in Amazon S3 (though managed by EBS, not directly accessible via the S3 console). The first snapshot is a full copy; subsequent snapshots are incremental — only the blocks that changed since the last snapshot are stored. Despite incremental storage, you can restore any single snapshot to a full volume. Snapshots are the primary mechanism for EBS volume backup, migration, and disaster recovery.
# Create a snapshot of an EBS volume with a description
aws ec2 create-snapshot \
--volume-id vol-0abc1234def567890 \
--description 'Production DB backup 2024-01-01' \
--tag-specifications 'ResourceType=snapshot,Tags=[{Key=Environment,Value=Production},{Key=Backup,Value=Daily}]'
# Monitor snapshot completion
aws ec2 describe-snapshots \
--snapshot-ids snap-0abc1234def567890 \
--query 'Snapshots[].{State:State,Progress:Progress}'Snapshot Costs and Lifecycle
You are billed for the actual storage consumed by incremental snapshot blocks across all snapshots of a volume — not for the volume size. If you delete intermediate snapshots, S3 consolidates the data so remaining snapshots still represent complete restore points. To manage costs at scale, use Amazon Data Lifecycle Manager (DLM) to create snapshot schedules and retention policies — for example, take daily snapshots, retain the last 7 daily + 4 weekly + 12 monthly, and delete older ones automatically.
# Create a DLM lifecycle policy for daily snapshots with 7-day retention
aws dlm create-lifecycle-policy \
--description 'Daily DB snapshots' \
--state ENABLED \
--execution-role-arn arn:aws:iam::111122223333:role/AWSDataLifecycleManagerDefaultRole \
--policy-details '{
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": ["VOLUME"],
"TargetTags": [{"Key": "Backup", "Value": "Daily"}],
"Schedules": [{
"Name": "DailySnapshots",
"CreateRule": {"Interval": 24, "IntervalUnit": "HOURS", "Times": ["03:00"]},
"RetainRule": {"Count": 7}
}]
}'All lessons in this course
- EBS Volume Types: gp3, io2, st1, sc1
- EBS Snapshots, Encryption, and RAID
- EFS: Shared File Storage for Linux
- FSx: Windows File Server and Lustre