Invoking lambda Function when File is Uploaded into S3

2022.03.31

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

S3

Simple and popular AWS Service for storage. Replicates data by default across multiple facilities. It charges per usage. It is deeply integrated with AWS Services. Buckets are logical storage units. Objects are data added to the bucket. S3 has a storage class on object level which can save money by moving less frequently accessed objects to a colder storage class.

AWS Lambda

A Serverless compute service that runs code as a reply to events and automatically takes care of the bottom resources. It runs code on high availability compute infrastructure and performs all the administration of the compute resources. A few examples are HTTP requests vis Amazon API Gateway, changes to objects in S3, and many others.

Demo

Creating an S3 bucket Creating a Lambda Function Checking the current logs Adding trigger to Lambda Going back to S3 and uploading object in the specified bucket Checking in the Cloudwatch log groups of lambda and notice that trigger has taken place