So the following code works
import boto3
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.Table('mytest')
myid = "123"
mylocation = "paris"
response = table.put_item(
Item={
'myid': myid,
'mylocation': mylocation
}
)
print("PutItem succeeded:")
But how do i pass json at runtime instead of hardcoding the myid and mylocation. I want to pass something like "{'myid':'123', 'mylocation:'paris'}" as a json string to put_item, Items. Is that possible in boto3 for dynamodb?