2018 Update
As of late 2018 there are two additional ways to automate EBS snapshots. I still use the original method of CloudWatch events as it's worked fine for years and I see no point in changing.
Ops Automator (OA)
Ops Automator is a very flexible set of lambda scripts provided by AWS. It's deployed with a CloudWatch template which is on the page above.
It's setup steps are
- The AWS CloudFormation template launches the core framework, which includes a suite of microservices (AWS Lambda functions) that manage triggering events, resource selection, task execution, concurrency control, and completion.
- Task configuration data, which defines the triggering event, how the task should be performed, which resources will be selected by the actions, and where these resources are located, is stored in an Amazon DynamoDB table.
- Solution-generated AWS CloudFormation templates configure tasks based on parameters you define, and the roles necessary to perform actions across accounts.
- The solution tracks all steps in the process, the selected resources, and the results of the actions, including possible errors, in a DynamoDB table.
- The solution also leverages Amazon CloudWatch Logs for logging. Warning and error messages are published to a solution-created Amazon Simple Notification Service (Amazon SNS) topic which sends messages to a subscribed email address.
Data Lifecycle Manager (DLM)
DLM Documentation. This is a simpler but less flexible solution which can back up volumes every 12 or 24 hours. I'm puzzled why AWS put this limitation on DLM - weekly, monthly, or a variable frequency would've been easy to implement.
DLM is integrated into the AWS console. I'm not going to copy and paste the documentation as AWS keeps things updated well, and links rarely break.
As of 2019 DLM lets you specify shorter intervals down to two hours, but still doesn't let you specify intervals of more than 24 hours.
2017 Update
As of 2017 there is another way to create regular snapshots - using Cloudwatch Events.
This lets you schedule snapshots, but it doesn't solve the problem of the volume being in use, so it's only a partial solution. There may be a way using CloudWatch Events to trigger something that does quiesce the volume.
Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.
In the navigation pane, choose Events.
Choose Create rule.
For Event Source, do the following:
-> Choose Schedule.
-> Choose Fixed rate of and specify the schedule interval (for example, 5 minutes). Alternatively, choose Cron expression and specify a Cron expression (for example, every 15 minutes Monday through Friday, starting at the current time).
For Targets, choose Add target and then select EC2 Create Snapshot API call.
For Volume ID, choose an EBS volume.
Choose Configure details.
For Rule definition, type a name and description for the rule.
For AWS permissions, choose the option to create a new role. This opens the IAM console in a new tab. The new role grants the built-in target permission to access resources on your behalf. Choose Allow. The tab with the IAM window closes.
Choose Create rule.