You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sam-eventbridge-ebs-snapshot/README.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Automated EBS Snapshot Creation on EC2 Shutdown using EventBridge
2
2
3
-
This pattern demonstrates how to automatically create EBS snapshots when an EC2 instance shuts down using EventBridge with direct EBS snapshot target integration.
3
+
This pattern demonstrates how to automatically create EBS snapshots when an EC2 instance shuts down using EventBridge with direct EBS snapshot target integration. It helps protect data on stateful applications or self-managed databases by capturing the volume state during instance shutdown events, reducing data loss risk and increasing recovery flexibility.
4
4
5
5
## Architecture
6
6
@@ -45,6 +45,20 @@ EC2 Instance State Change → EventBridge Rule → EBS CreateSnapshot (Direct Ta
45
45
- Snapshots are created automatically for the specified volume ID
46
46
- Pure infrastructure-as-code approach
47
47
48
+
## Scope and Limitations
49
+
50
+
- This pattern targets a single EBS volume specified via the VolumeId parameter
51
+
- It does not automatically detect or snapshot all volumes attached to an instance
52
+
- Works with EBS volumes of any size (snapshot creation is asynchronous and incremental)
53
+
- Only triggers on graceful EC2 state changes (stopping, shutting-down, terminated)
54
+
- Will not capture snapshots during abrupt failures where no state change event is emitted
55
+
56
+
## Use Cases
57
+
58
+
- Protecting stateful applications or self-managed databases running on EC2
59
+
- Preserving data during EC2 instance stop/terminate events (patching, maintenance)
60
+
- Safeguarding against accidental shutdowns during testing
61
+
48
62
## Testing
49
63
50
64
Stop or terminate the monitored EC2 instance, then check your EC2 console snapshots section. A snapshot will be created automatically when the instance shuts down.
0 commit comments