title: aws-sdk-v2 for ec2 listing
body: <p>is this right way to do this ? Please help if there are other better ways to do this?</p>
  
  <pre><code>#! /usr/bin/ruby
  require 'aws-sdk'
  
  client = Aws::EC2::Client.new(region: 'us-west-2')
  resp = client.describe_instances
  resp.reservations.each do |node, num = 0|
    puts "#{node.instances[num].instance_id}"
  end
  </code></pre>