title: Upload multiple files to S3 using Lambda/Python
body: <p>so I'm writing a Lambda function that is triggered by events from DynamoDB Streams, and I want to write these events to S3 (to create a data lake). but this code is only uploading the same json file. How can I upload multiple files into s3 without overwriting this one?</p>
  <pre><code>   import boto3
     import json
     
     s3 = boto3.client('s3')
     
     def lambda_handler(event, context):
         
       bucket ='bto-history'
       dynamodb = boto3.resource('dynamodb')
       tableUsers = dynamodb.Table('Users')
         
       jsonToUpload = event['Records']
     
       uploadFile = bytes(json.dumps(jsonToUpload).encode('UTF-8'))
       
       jsonToUpload = &quot;userUpdate&quot; + &quot;.json&quot;
     
       s3.put_object(Bucket=bucket, Key=jsonToUpload, Body=uploadFile)
     
       
       return {
         'statusCode': 200,
         'body': event
         }
  </code></pre>