title: AWS Lambda Python function error 'Process exited before completing request'
body: <p>I have a really simple script that I am using to enumerate the list of AMIs in my account and collect their IDS into a list. </p>
  
  <pre><code>import boto3
  
  resource = boto3.resource('ec2')
  
  def lambda_handler(event, context):
      amis = resource.images.all()
      ids = [ami.id for ami in amis]
  </code></pre>
  
  <p>When I run this piece, I get the following error: </p>
  
  <pre><code>{
    "errorMessage": "RequestId: XXX-XXXX-XXXX-XXXX-XXXX Process exited before completing request"
  }
  </code></pre>
  
  <p>I can run other queries without a problem so permissions is not an issue. </p>
  
  <p>Any advice would be greatly appreciated.</p>