2

Does anyone know if it's possible to automate the creation of EBS snapshots from the online EC2 Management console (Say every day or every hour) and then tell it how long to keep them (Pruning them)?

I don't use the command line tools, so would hope there is an option (That I can't currently see!) to automate snapshots? I know you can do it via third party applications and sites like Ylastic - But was hoping this would be built in by now?

YodasMyDad
  • 329
  • 6
  • 14

4 Answers4

2

Unfortunately there is no feature available in the management console to create daily / hourly EBS snapshots. The only options are the ones you have highlighted although some people have created command line scripts which can do what you require and are relatively straight forward to configure for your own requirements.

https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup

DanBarber
  • 67
  • 3
  • 9
1

It is now possible to automate snapshotting from AWS console using CloudWatch rules.

As explained in AWS CloudWatch documentation

Create a rule that takes snapshots on a schedule. You can use a rate expression or a cron expression to specify the schedule. For more information, see Schedule Expressions for Rules.

To create a rule

1. Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

2. In the navigation pane, choose Events, Create rule.

3. For Event Source, do the following:

a. Choose Schedule.

b. 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).

4. For Targets, choose Add target and then select EC2 Create Snapshot API call.

5. For Volume ID, choose an EBS volume.

6. Choose Configure details.

7. For Rule definition, type a name and description for the rule.

8. 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 permissions to access resources on your behalf. Choose Allow. The tab with the IAM window closes.

9. Choose Create rule.
hannesh
  • 151
  • 2
0

Now is possible with Amazon Data Lifecycle Manager: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html

0

The problem with implementing a generic backup schedule from the AWS Console is that Amazon doesn't know anything about what's on your volumes. That's why there are solutions like ec2-consistent-snapshot that can take care of things like freezing the filesystem and flushing & locking databases prior to taking the snapshot. Taking these extra steps help ensure that you would actually be able to use a snapshot without having to go through data cleanup / recovery steps.

jstell
  • 546
  • 3
  • 4