Event-sqs.py 326 B

123456789101112
  1. import json
  2. import boto3
  3. def lambda_handler(event,context):
  4. # TODO
  5. message = json.loads(event['Records'][0]['body'])['Message']
  6. mykey = json.loads(event['Records'][0]['body'])['MessageAttributes']['name']['Value']
  7. return {
  8. 'statusCode': 200,
  9. 'body': json.dumps('Hello from Lambda!')
  10. }