Automate File Processing with S3 Event Notifications

Consider a scenario where you need to perform some kind of automated processing on files that arrive at a particular location as soon as they come in. It could be as small as two business processes talking to each other by dropping files at a predetermined location or as large as two businesses exchanging EDI files at an FTP server.

In the pre-cloud days, this would be accomplished by building a watcher service that polls the location for new files & takes actions when it finds something. With Amazon S3 though, all it takes is a few clicks to configure an “event notification.”

As shown below, event notifications can be configured for various S3 events, the most common use case being object create events. The notifications can be sent to either an SNS topic, an SQS queue or you can have a Lambda function execute your custom business logic on the file.

You can provide a prefix if you only want notifications for object events in a particular directory. You can also provide suffix to get notified of only certain file types (.csv, .png, etc.). All event notifications, regardless of their configured destination, always contain all details needed for a receiver to identify, fetch & process the file that triggered the notification. For more details, see the official documentation.

About the Author ✍🏻

Harish KM is a Principal DevOps Engineer at QloudX & a top-ranked AWS Ambassador since 2020. 👨🏻‍💻

With over a decade of industry experience as everything from a full-stack engineer to a cloud architect, Harish has built many world-class solutions for clients around the world! 👷🏻‍♂️

With over 20 certifications in cloud (AWS, Azure, GCP), containers (Kubernetes, Docker) & DevOps (Terraform, Ansible, Jenkins), Harish is an expert in a multitude of technologies. 📚

These days, his focus is on the fascinating world of DevOps & how it can transform the way we do things! 🚀

Leave a Reply

Your email address will not be published. Required fields are marked *