Setup S3 Trigger with Lambda and dynamoDB in 4k

Описание к видео Setup S3 Trigger with Lambda and dynamoDB in 4k

I have created Setup S3 Trigger with Lambda and dynamoDB
follow the steps to create it
here is the python code for it
***********
import boto3
from uuid import uuid4
def lambda_handler(event, context):
s3 = boto3.client("s3")
dynamodb = boto3.resource('dynamodb')
for record in event['Records']:
bucket_name = record['s3']['bucket']['name']
object_key = record['s3']['object']['key']
size = record['s3']['object'].get('size', -1)
event_name = record ['eventName']
event_time = record['eventTime']
dynamoTable = dynamodb.Table('newtable')
dynamoTable.put_item(
Item={'unique': str(uuid4()), 'Bucket': bucket_name, 'Object': object_key,'Size': size, 'Event': event_name, 'EventTime': event_time})
**********

Комментарии

Информация по комментариям в разработке