require 'meroku/infrastructure/server' module Meroku # Logic related to the infratructure that powers meroku module Infrastructure extend Meroku::Aws::Ec2 def self.servers ec2_client.describe_instances( filters: [ { name: 'tag:Name', values: ['node'] }, { name: 'instance-state-name', values: %w[running pending] } ] ).reservations.map do |xx| Meroku::Infrastructure::Server.new(xx.instances.first.instance_id) end end def self.each_server servers.each { |s| yield s } end end end