Jan-08-2020, 03:48 PM
(This post was last modified: Jan-08-2020, 03:49 PM by Clunk_Head.)
I haven't run any of your code, but you need to indent after you use a colon.
Also, you do not appear to be calling lambda_handler anywhere in your code.
import boto3 def lambda_handler(event, context): s3 = boto3.client("s3") if event: print("Event : ", event) file_obj = event["Records"][0] filename = str(file_obj['s3']['object']['key']) print("Filename: " , filename) fileObj = s3.get_object(Bucket = "chargifytesting" , Key=filename) file_content = fileObj["Body"].read().decode('utf-8') print(file_content)Try that and post your errors if it doesn't work
Also, you do not appear to be calling lambda_handler anywhere in your code.