I have the following json file
{"columnwithoutname":"structureet","nofinesset":810001792,"nofinessej":810001784}
{"columnwithoutname":"structureet","nofinesset":670797117,"nofinessej":670010339}
I want to insert it in DynamoDB using Lambda. This is what I did:
def lambda_handler(event, context):
bucket=event['b']
file_key=event['c']
table=event['t']
recList=[]
s3 = boto3.client('s3')
dynamodb = boto3.client('dynamodb')
obj= s3.get_object(Bucket=bucket, Key=file_key)
recList=obj['Body'].read().split('\n')
for row in recList:
response = dynamodb.put_item(TableName='test-abe', Item=row)
But I have this error:
"errorMessage": "Parameter validation failed:\nInvalid type for parameter Item
Apparently I also need to precise the type of each column so it could be accepted. Anyway to do it automatically? I want all columns to be strings. thank you