Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Deleting EBS Snapshots with aws-sdk
require 'rubygems'
require 'active_support/time'
require 'aws-sdk'
threshold = 2.months.ago
ec2 =
select {|s| s.volume_id == 'vol-12345678' && s.start_time < threshold}.
each {|s| puts "Bye-bye #{s.description}"; s.delete}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.