Menu
EBS Snapshot Scheduler on AWS
EBS Snapshot Scheduler on AWS

Architecture Overview

Automatic deployment of this solution configures the following components and functionality.


        EBS Snapshot Scheduler architectural overview

Figure 1: EBS Snapshot Scheduler on AWS

The AWS CloudFormation template sets up an Amazon CloudWatch event that runs every five minutes, by default. This event invokes the EBS Snapshot Scheduler AWS Lambda function. During configuration, the user defines a default snapshot time and time zone (UTC will be used if a time zone is not specified) as well as a custom tag that the EBS Snapshot Scheduler will use to identify applicable Amazon EC2 instances. These values are stored in Amazon DynamoDB, and the Lambda function retrieves them each time it runs. The customer then applies the custom tag to applicable Amazon EC2 instances and the EBS Snapshot Scheduler takes snapshots of all volumes attached to those instances.

For example, a user might assign the custom tag the name (tag key) scheduler:ebs-snapshot, and define a default snapshot time of 2030 UTC (8:30 PM) to be applied Monday through Thursday. In this example, the EBS Snapshot Scheduler runs every five minutes, but it only takes snapshots of tagged instances at 2030 UTC, Monday through Thursday.

Note

The Lambda function is invoked at five-minute intervals. If the default snapshot time is set between these intervals, the snapshot will be taken at the next Lambda invocation. For example, if the default snapshot time is set to 2032 UTC, and the Lambda runs at 2030 UTC and 2035 UTC, the snapshot will be taken at 2035 UTC.

Note that this solution allows the user to define custom snapshot time and retention parameters that override the default values for an individual instance. Users can also append additional characters to the custom tag name (e.g. scheduler:ebs-snapshot:group1) to easily create multiple snapshot schedules from the same EBS Snapshot Scheduler deployment. See Step 2. Tag Your Amazon EC2 Instances for detailed information about tag names and using the tag value to set custom parameters.

The solution includes an optional feature to automatically delete the EBS snapshots after a defined period. The default retention period is 15 days, but users can modify this default during configuration, and also adjust retention periods for individual instances (see Applying Custom Parameters). When this feature is enabled, the solution will apply a tag to applicable EBS snapshots to flag them for deletion.

When the EBS Snapshot Scheduler AWS Lambda function identifies an Amazon EC2 instance with a scheduler:ebs-snapshot tag, it will check if the tag value contains custom override parameters for the snapshot time or retention days. If there are no custom parameters, the Lambda function will initiate the snapshot and mark that snapshot for deletion according to the default settings.

Important

The EBS Snapshot Scheduler will create and delete snapshots for EBS volumes that are attached to both running and stopped EC2 instances.