Search code examples
pythonamazon-s3webhookszapier

Best way to 'listen' to s3 bucket for new file?


I have connected zapier to a webhook I am listening too, which sends a JSON file into my s3 bucket.

I have some python code that I want to execute when a new file is uploaded into the bucket, in real time over the file.

What is the best way to 'listen' for the upload of this file into the s3 bucket?


Solution

  • You can setup an Amazon's CloudWatch Event to listen for when a new object is put into a S3 bucket. You can configure the event to work with a specific S3 bucket. When a new object is put into the bucket you can configure the event to trigger a Lambda function that will execute whatever custom Python code you want to run when a new object is added.

    Your question is pretty broad so I can't get into specifics, but you can checkout the AWS documentation that provides examples to guide you through the process. AWS CloudWatch Documentation.