bsmsapp/terraform/resources/lambda/lambdaUpdate/lambda_handler.py

23 lines
474 B
Python

import json
import boto3
def main(event, context):
print(event)
record = event['Records'][0]
print(record)
sqs_message = json.dumps(event)
print(sqs_message)
body = record["body"]
body = body.replace('\n', '')
body = json.loads(body)
query = body["body-json"]
print(query)
client = boto3.resource('dynamodb', region_name="us-east-1")
table = client.Table("AWSDynamoDB-g3")
table.put_item(Item=query)
return event