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

19 lines
387 B
Python

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