skip to Main Content

I have a Event Bridge Trigger set on a s3 bucket and everytime we upload an object, it triggers a NotifyEvent in Cloud Trail. I am trying to extract the bucket name and key from the payload

2

Answers


  1. Try to check your characters, confirm it is legitimate.

    Login or Signup to reply.
  2. You can set up a lambda for that:

    import json
    
    def lambda_handler(event, context):
        # Extract bucket name and object key from the event payload
        for record in event['Records']:
            bucket_name = record['s3']['bucket']['name']
            object_key = record['s3']['object']['key']
                        
            print(f'Bucket: {bucket_name}, Key: {object_key}')
            
            # Add your custom processing logic here
    

    Why would you use AWS glue for that?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search