Created
September 9, 2015 17:42
-
-
Save bhouse/4cd8dd7b625a345a64b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'aws-sdk' | |
ec2 = Aws::EC2::Client.new(region: 'us-west-1') | |
volumes = ec2.describe_volumes.volumes | |
volume_sizes = {} | |
volumes.each do |vol| | |
volume_sizes[vol.volume_type] ||= [] | |
volume_sizes[vol.volume_type] << vol.size | |
end | |
volume_sizes.each do |type, sizes| | |
puts format('%s: %d', type, sizes.reduce(:+)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment