class Soror
Constants
- VERSION
Public Class Methods
new()
click to toggle source
# File lib/soror.rb, line 16 def initialize @ec2 = Aws::EC2::Client.new end
search_by(tags)
click to toggle source
# File lib/soror.rb, line 11 def search_by(tags) new.search_by(tags) end
Public Instance Methods
search_by(tags)
click to toggle source
# File lib/soror.rb, line 20 def search_by(tags) filters = [{ name: 'instance-state-name', values: ['running'] }] tags.each do |k, v| filters << { name: "tag:#{k}", values: [v] } end @ec2.describe_instances(filters: filters).reservations.map(&:instances).flatten end