Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Configuring SNS Push Notifications on S3 Bucket Events Inside of the AWS Console

In this live AWS environment, you will configure an S3 bucket to trigger AWS Simple Notification Service notifications whenever an object is added to an S3 bucket. This scenario will help you understand how you can architect your application to respond to S3 bucket events using other services such as SNS, AWS, Lambda, and others.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 45m
Published
Clock icon Jul 22, 2018

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create an S3 Bucket

    Create an S3 bucket inside the AWS console:

    1. Navigate to the S3 portion of the console.
    2. Click Create Bucket.
    3. Give your bucket a unique name and continue to create the bucket without adding additional configuration.
  2. Challenge

    Create an SNS Topic

    Navigate to the Simple Notification Service portion of the AWS Console and create an SNS Topic:

    1. Go to the SNS dashboard in the AWS Console.
    2. Create an SNS Topic.
    3. (Eventually) edit the topic's resource policy so that the S3 bucket will be able to send events to that topic.

    Ignore any KMS errors - the error won't impact the Hands-On lab.

  3. Challenge

    Configure the Bucket — Part 1

    Setting up events allows us to receive notifications whenever there are events happening in our bucket that we want to be notified about.

    Navigate back in the S3 Management Console:

    1. Configure your bucket settings.
    2. Event name: "S3ObjectCreated".

    We'll then receive an error: "Unable to validate the following destination configurations. Permissions on the destination do not allow S3 to publish notifications from this bucket." The reason we got this is because we haven't yet configured our SNS topic policy to accept notification events from our S3 bucket. Let's do that now.

  4. Challenge

    Modify the SNS Topic Policy

    Navigate to Simple Notifications Services Console.

    Add the following code:

    {
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
        },
            "Action": "SNS:Publish",
            "Resource": "SNS_ARN_REPLACE_ME",
            "Condition": {
                "StringEquals": {
                    "aws:SourceArn": "S3_BUCKET_ARN_REPLACE_ME"
                }
            }
        },
    

    In the SNS:Publish section, where it says, SNS_ARN_REPLACE_ME, paste in the SNS topic you added to that text file or note a minute ago. Then, copy and paste your S3 bucket ARN where it says S3_BUCKET_ARN_REPLACE_ME.

    Make sure to leave the comma after the last bracket in our new statement, as this allows us to have more than one statement for this SNS topic's policy.

    Create the Bucket - Part 2

    Navigate back in the S3 Management Console.

    1. Configure bucket settings again.

    This time, we should see we now have one active notification.

  5. Challenge

    Create the Email Subscription and Create the SMS Subscription

    Create the Email Subscription

    1. Navigate to Simple Notification Service.
    2. Configure email settings.
    3. Accept confirmation AWS email from inbox.
    4. If successful, subscription confirmation page will appear.

    Create the SMS Subscription

    1. Navigate to SNS Topics.
    2. Select S3Events.
    3. Insert "HELLO" under Subject-optional.
    4. Insert "This is a test message" under Message body.
    5. Save changes.
    6. If successful, Amazon S3 Notification email sent to your inbox.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans