Implementing S3 Event Notifications with AWS Lambda | Scribe

    Implementing S3 Event Notifications with AWS Lambda

    • Hafeez Baig |
    • 30 steps |
    • 3 minutes
    information ordinal icon
    Refer to the following guide to learn how to use IAM in the cloud\ <https://scribehow.com/shared/Creating_an_IAM_User_and_User_Group_in_AWS_Management_Console__hWNiiXlcRJKFqYZZEJD-cg>
    1
    Sign in to **AWS Management Console** as an **IAM User** **Pre-requisite** - Ensure you have selected the AWS region closest to your location\ For this guide, we will be using us-east-2 (Ohio) as a preferred choice
    2
    Type **Lambda** in the search bar and click on **Lambda** to view the Lambda Dashboard
    information ordinal icon
    **What is Lambda in AWS?** AWS Lambda is a serverless compute service provided by Amazon Web Services (AWS) that allows you to run code without provisioning or managing servers. With Lambda, you can execute code in response to events triggered by various AWS services or custom events.
    3
    On the Lambda dashboard click on **Create function** button from the top right corner
    4
    **Create function** wizard will open, select the option **Author from scratch**
    5
    Scroll to the **Basic information** section, provide the Function name as "**my-s3-notification**"
    6
    Scroll to the **Runtime** dropdown and select the **Node.js.20.x** or whichever version is the latest version
    7
    Scroll the page an click on the **Create function** button
    8
    Successfully created the function "**my-s3-notification**"
    9
    On the **Code source** section, give the code [[console.log(event)]]
    information ordinal icon
    **What does console.log(event) do?** The statement [[console.log(event)]] is used to print the value of the `event` variable to the console. It's a debugging technique often used to inspect the contents of variables or objects during the execution of a script.
    10
    Open the AWS Management console in a new tab
    11
    Type **S3** in the search bar and click on **S3** to view the S3 Dashboard
    12
    On the Amazon S3 Dashboard, scroll to the **General purpose buckets** section and click on the Name "**my-aws-bucket-in28minutes**"
    information ordinal icon
    Refer to the following guide to learn how to create S3 Bucket<https://scribehow.com/shared/Creating_an_S3_Bucket_and_Exploring_the_UI__0TFMdpbkQvS6jOisdkQjeA>
    13
    **my-aws-bucket-in28minutes** wizard will open, click on the **Properties** tab
    14
    Scroll to the **Event notifications** section
    information ordinal icon
    **What are Event Notifications in AWS?** In AWS (Amazon Web Services), Event Notifications refer to a mechanism for receiving notifications or triggering actions in response to events that occur within AWS services.
    15
    Click on the **Create event notification** button on the right side