I kept following JSON in S3 bucket \'test\'
{
\'Details\' : \"Something\"
}
I am using following code to read this JSON and printing the
You can use the below code in AWS Lambda to read the JSON file from the S3 bucket and process it using python.
import json
import boto3
import sys
import logging
# logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
VERSION = 1.0
s3 = boto3.client('s3')
def lambda_handler(event, context):
bucket = 'my_project_bucket'
key = 'sample_payload.json'
response = s3.get_object(Bucket = bucket, Key = key)
content = response['Body']
jsonObject = json.loads(content.read())
print(jsonObject)