Explorar o código

update py/Event-sqs.py.
events sqs

xdc %!s(int64=5) %!d(string=hai) anos
pai
achega
5e18b28df3
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  1. 12 0
      py/Event-sqs.py

+ 12 - 0
py/Event-sqs.py

@@ -0,0 +1,12 @@
+import json
+import boto3
+
+def lambda_handler(event,context):
+    # TODO
+    message = json.loads(event['Records'][0]['body'])['Message']
+    mykey = json.loads(event['Records'][0]['body'])['MessageAttributes']['name']['Value']
+
+    return {
+        'statusCode': 200,
+        'body': json.dumps('Hello from Lambda!')
+        }