Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import boto3
- s3 = boto3.client('s3', region_name='ap-northeast-1')
- def lambda_handler(event, context):
- bucket = '*xxxxxx*'
- key = 's3-upload.json'
- try:
- response = s3.get_object(Bucket=bucket, Key=key)
- print('--------------------------------------')
- print(response)
- print('--------------------------------------')
- body = response['Body'].read()
- print(body)
- print('--------------------------------------')
- print("CONTENT TYPE: " + response['ContentType'])
- except Exception as e:
- print('Error getting object.')
- print(e)
- raise e
Add Comment
Please, Sign In to add comment