Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

You want to regularly backup your EC2 instances, but only keep the last N images so that you can retain an isolated use case oriented set of images in an orderly fashion.

Step-by-step guide

This can be achieved by using the EC2 Image task's Grow & Prune Image Backup Set action as follows:

  1. Specify the Instance ID (or a Filters JSON) to select the instance(s) you want to retain backups for.

  2. Choose an applicable Backup Set name for your use case so that you can retain different sets and identify the images in the AWS Management Console (they will be automatically tagged with that name).

  3. Specify the Backup Retention number N (the number of images that should be retained in this backup set).

  4. Arrange for the Bamboo build to trigger at an interval applicable for your use case, for example via cron-based scheduling to retain daily backups of your instances, or after you have pushed changes to your repository to backup your instances before deploying new code.

    What is a Backup Set for EC2 Instances?

    A Backup Set allows to retain an isolated use case oriented set of the last at most N images of one or more EC2 instances.

    When the EC2 Image task's Grow & Prune Image Backup Set action executes, it will:

    1. Create a new EC2 image for each selected EC2 instance and tag the image with a key Backup Policy and a value based on the Backup Set name (thus "grow the image backup set")
    2. Enumerate all existing images for the selected EC2 instance(s) that are tagged with a key Backup Policy whose value matches the Backup Set name
    3. If it finds more images in this Backup Set than defined by the Backup Retention number, it will delete the oldest images in FIFO order until only the desired number is left (thus "prune the image backup set")

    (lightbulb) While there are also separate Grow Image Backup Set and Prune Image Backup Set actions to separate the two activities (for example, to only grow the backup set on each work day, but prune it to the last work day's image at the end of the week), the Grow & Prune Image Backup Set action covers most rotating backup use cases in a single operation.




  • No labels