title: bson.errors.InvalidDocument: Cannot encode object: ec2.Image()
body: <p>When I try to insert the following document:</p>
  
  <pre><code> aws_data = {u'ami_launch_index': 0,
               u'image': ec2.Image(id='xxx')
              }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>bson.errors.InvalidDocument: Cannot encode object: ec2.Image(id='xxx')
  </code></pre>
  
  <p>MongoDB is not able to encode <code>ec2.Image(id='ami-xxx')</code> </p>
  
  <p>How do I fix it? </p>