title: Displaying EC2 Instance name using Boto 3
body: <p>I'm not sure how to display the name of my instance in AWS EC2 using <code>boto3</code></p>
  
  <p>This is some of the code I have:</p>
  
  <pre><code>import boto3
  
  ec2 = boto3.resource('ec2', region_name='us-west-2')
  vpc = ec2.Vpc("vpc-21c15555")
  for i in vpc.instances.all():
      print(i)
  </code></pre>
  
  <p>What I get in return is </p>
  
  <pre><code>...
  ...
  ...
  ec2.Instance(id='i-d77ed20c')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uq24o.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uq24o.png" alt="enter image description here"></a></p>
  
  <p>I can change <code>i</code> to be <code>i.id</code> or <code>i.instance_type</code> but when I try <code>name</code> I get:</p>
  
  <p><code>AttributeError: 'ec2.Instance' object has no attribute 'name'</code></p>
  
  <p>What is the correct way to get the instance name?</p>