Using python in AWS Lambda, how do I put/get an item from a DynamoDB table?
In Node.js this would be something like:
dynamodb.getItem({
\"Key\": {\"f
Using latest AWS SDK
import boto3
def lambda_handler(event, context):
# this will create dynamodb resource object and
# here dynamodb is resource name
client = boto3.resource('dynamodb')
# this will search for dynamoDB table
# your table name may be different
table = client.Table("dynamoDB")
print(table.table_status)
table.put_item(Item= {'id': '34','company': 'microsoft'})
If your are using AWS you can use this code sample, only you have to give permissions to this lambda function, you can find details in link