How to schedule maintenance of AMIs

Follow these steps to schedule Maintenance (retention period) of the old AMIs (Images):

Go to the EC2 section by selecting EC2 from the Main Menu.

Select AWS account and region of EBS Volume to schedule backup.

From the menu's the EC2 Instance list, select Schedule AMI Backup.

Under Scheduler Window is the AMI Maintenance section, where the following configurations can be made:

Two options define which AMI (Images) should not be deleted:

Keep All From Last – Keeps all AMIs created within the last “x” periods (select periods as hours, days, weeks, months, or years), e.g. to keep all AMIs created within the last 45 days, this is how your setup appears:

Keep One Per Period From Last – Keeps the last AMI created in the given period (hours, days, weeks, months, or years), e.g. to keep one AMI per week from the last 8 weeks, this is how your setup appears:

Create multiple maintenances to manage more complex needs, e.g. to setup maintenance that would keep all AMIs from the last 7 days, 1 AMI per week from the last 4 weeks, and 1 AMI per month from the last 4 months, this is how your setup appears:

When using cross-region copy Images in your scheduler, another set of options is available allowing creation of more complex scenarios. Three options that allow you to schedule separate maintenance for source and destination regions are available on the drop down list:

Apply Only to Source Region – Maintenance is applied only to AMIs in source region

Apply Only to Cross Region – Maintenance is applied only to AMIs in destination region

Apply to Both Regions – The same maintenance is applied to both source and destination regions

To delete all snapshots associated with AMI, check the Delete AMI Snapshots option.

When the maintenance is running, all AMIs that do not match scheduled criteria are deleted (except the most recent one) – for security reasons, the last AMI is never deleted.

Also, maintenances scheduled under the EC2 section delete all AMIs that do not meet your criteria, including AMIs created by our system.

Use templates to include only AMIs created by our system. Under the Schedule AMI Maintenance action is the checkbox Delete only Snapshots that were created by associate template. To use this feature, both Schedule AMI Backup and Schedule AMI Maintenance must be associated with the same template.

Additionally, templates can be used to apply identical maintenance to multiple EC2 Instances.

To learn more about templates, please read Introduction to Scheduler Templates

Note: the maintenance feature is only available under Deluxe or higher-level plans.