title: how can I make a s3 bucket sub images iteration generic
body: <p>my bucket on s3 is named as 'python' and its subfolder is  'boss' . So I want to get all images of folder boss in lambda function. currently I am hard-coding values but putting image in root not in subfolder.  </p>
  
  <pre><code>bucket="python"
  key="20180530105812.jpeg"
  </code></pre>
  
  <p>then I want to call this function one by one for all images</p>
  
  <pre><code>def lambda_handler(event, context):
      # Get the object from the event
      bucket="ais-django"
      key="20180530105812.jpeg"
  
      try:
  
          # Calls Amazon Rekognition IndexFaces API to detect faces in S3 object 
          # to index faces into specified collection
  
          response = index_faces(bucket, key)
  
          # Commit faceId and full name object metadata to DynamoDB
  </code></pre>