import json
import boto3
def lambda_handler(event,context):
#TODO implement
client_dynamo=boto3.resource(‘dynamodb’)
table=client_dynamo.Table(‘testing’)
try:
response=table.put_item(Item=event)
return “Done”
except:
raise
import json
import boto3
def lambda_handler(event,context):
#TODO implement
client_dynamo=boto3.resource(‘dynamodb’)
table=client_dynamo.Table(‘testing’)
try:
response=table.put_item(Item=event)
return “Done”
except:
raise
I’m not at all familiar with Python code so I’m not sure what this is doing. It looks like you’re loading a DynamoDB and attempting to insert something into a table. Check out the docs for the go SDK as a good starting point:
Also head over specifically to their DynamoDB examples:
There is an example that shows how to use PutItem
specifically:
I believe you could modify that example code and accomplish what your code snippet above does.
Dean pointed you to examples for DynamoDB. For the lambda function see: