I read in a file from S3 bucket using Python:
import json
import boto3
s3 = boto3.client('s3')
def lambda_handler(event, context):
bucket = 'finalyearpro-aws'
key = 'StudentResults.json'
try:
data = s3.get_object(Bucket=bucket, Key=key)
json_data = data['Body'].read().decode('utf-8')
print (json_data)
except Exception as e:
raise e
But it does not display in the response, instead it creates it as function logs, how do I display it in the response instead. See Picture Below.