Created
May 28, 2019 11:19
-
-
Save bahrmichael/c5c9eaf4733bc90344de84616407017f 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
def handle(event, context): | |
print('Received %d records' % len(event['Records'])) | |
for record in event['Records']: | |
# as we're using ttl to schedule executions, we do not care about inserts or updates, | |
# only about removes which happen after the ttl is hit | |
event_name = record['eventName'] | |
if event_name != 'REMOVE': | |
print('Skipping %s' % event_name) | |
continue | |
# note that this image is in DynamoDB style, not a regular python object and needs to be converted accordingly | |
old_image = record['dynamodb']['OldImage'] | |
print(old_image['payload']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment