title: Is it possible to get AWS Cognito user attributes in the Lambda triggers?
body: <p>When some files upload on my s3, i want to send email to all of cognito user's email.
  i made s3 upload trigger with my lambda. Here is the code.</p>
  <pre><code>def lambda_handler(event, context):
  bucket = event['Records'][0]['s3']['bucket']['name']
  key = urllib.parse.unquote_plus(event['Records'][0]['s3']['object']['key'], encoding='utf-8')
  try:
      response = s3.get_object(Bucket=bucket, Key=key)
      text = response[&quot;Body&quot;].read().decode()
      data = json.loads(text)
      print(data)
      transactions = data['transactions']
      for record in transactions:
          print(record['transType'])
      return 'Success!'
  
  except Exception as e:
      print(e)
      raise e
  </code></pre>
  <p>Then how can i do?</p>
  <pre><code>import boto3 
  client = boto3.client('cognito-idp') 
  response = client.list_users(UserPoolId='') 
  print(response)
  </code></pre>
  <p>I tried this code it worked on my python id, but it didn't work my lambda.
  Can you help me?</p>
  <p>p.s)
  when i execute that s3 trigger lambda code, i can find this message.</p>
  <pre><code>&quot;errorMessage&quot;: &quot;'Records'&quot;,
  &quot;errorType&quot;: &quot;KeyError&quot;,
  &quot;stackTrace&quot;: [
   [
     &quot;/var/task/lambda_function.py&quot;,
     2,
  &quot;lambda_handler&quot;,
  &quot;bucket = event['Records'][0]['s3']['bucket']['name']&quot;
  ]
  </code></pre>
  <p>]
  }
  But i can find log and dot on my monitor when i upload s3 file.</p>