Process file in AWS Lambda local and upload the same file to S3 bucket

Process file in AWS Lambda local and upload the same file to S3 bucket 


import boto3

s3 = boto3.resource('s3')

client_name = boto3.client('s3') 

my_bucket = s3.Bucket(bucket_source)

local_file_name = '/tmp/file.csv'

f = open(local_file_name, 'w')

        f.write("hello")

client_name.upload_file(local_file_name, bucket_target, file.csv")

f.close()

Comments