Tutorial: Schedule automated Amazon EBS snapshots using EventBridge - Amazon EventBridge

Tutorial: Schedule automated Amazon EBS snapshots using EventBridge

You can run EventBridge rules on a schedule. In this tutorial, you create a snapshot of an existing Amazon Elastic Block Store (Amazon EBS) volume on a schedule. You can choose a fixed rate to create a snapshot every few minutes or use a cron expression to create the snapshot at a specific time of day.

Important

To create rules with built-in targets, you must use the AWS Management Console.

Step 1: Create the rule

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 Creating an Amazon EventBridge rule that runs on a schedule.

To create a rule

  1. Open the Amazon EventBridge console at https://console.aws.amazon.com/events/.

  2. In the navigation pane, choose Rules.

  3. Choose Create rule.

  4. Enter a name and description for the rule.

  5. For Define pattern, do the following:

    1. Choose Schedule.

    2. Do one of the following:

      • Choose Fixed rate every and specify the schedule interval, for example, 5 minutes.

      • Choose Cron expression and specify a cron expression, for example, every 15 minutes, Monday through Friday, starting at the current time.

  6. For Select event bus, choose AWS default event bus. You can only use the default event bus for scheduled rules.

  7. For Target, choose select EC2 CreateSnapshot API call.

  8. For Volume ID, enter the volume ID of the Amazon EBS volume.

  9. Choose Create a new role for this specific resource. The new role grants the target permissions to access resources on your behalf.

  10. Choose Create.

Step 2: Test the rule

You can verify your rule works by viewing your first snapshot after it's taken.

To test your rule

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Elastic Block Store, Snapshots.

  3. Verify that the first snapshot appears in the list.

Step 3: Confirm success

If you see the a snapshot in the list, you've successfully completed this tutorial. If the snapshot isn't in the list, start troubleshooting by verifying the rule was created successfully.

Step 4: Clean up your resources

You can now delete the resources that you created for this tutorial, unless you want to retain them. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account.

To delete the EventBridge rule

  1. Open the Rules page of the EventBridge console.

  2. Select the rule that you created.

  3. Choose Delete.

  4. Choose Delete.