title: How to specify aws region within boto program?
body: <p>I want to list the <code>ec2</code> instances in aws account with boto module.I am getting the issue as </p>
  
  <blockquote>
    <p>"You must specify a region".Here is the program.</p>
  </blockquote>
  
  <pre><code>import boto3
  ec2 = boto3.resource('ec2')
  for instance in ec2.instances.all()
  print instance.id, instance.state
  </code></pre>
  
  <p>I didn't specify any default region. How can I specify it programmatically                                                                                           ?</p>