do |src_sg| puts "#{src_sg.id}, #{src_sg.name}" src_sg.ip_permissions.each do |p| if p.ip_ranges.include? src_ip src_sg.authorize_ingress(p.protocol, p.port_range, dst_ip) src_sg.revoke_ingress(p.protocol, p.port_range, src_ip) end end end 14 36
as << a end end ss = {} r.snapshots.sort {|a,b| b.start_time <=> a.start_time }.map do |s| ss[s.volume_id] = s unless ss.include? s.volume_id end as.each do |a| vid = a.volume.id if ss.include? vid puts "#{a.instance.id} => (#{ss[vid].start_time})" end end 18 36