Last active
March 4, 2019 07:09
-
-
Save cqsd/fb374572fef4b79323321834713278c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
s3 = boto3.client('s3') | |
def lambda_handler(event, context): | |
# s3 trigger can have multiple records | |
for record in event['Records']: | |
bucket = record['s3']['bucket']['name'] | |
obj_key = record['s3']['object']['key'] | |
obj = s3.get_object(Bucket=bucket, Key=obj_key) | |
body = obj['Body'] | |
print(body.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment