Overview
Lab details
- This lab walks you through the creation and subscription of an Amazon SNS Topic.
- Duration: 30 minutes
- AWS Region: US East (N. Virginia) us-east-1
Introduction
What is SNS?
- SNS stands for Simple Notification Service.
- Amazon SNS is a fully managed service provided by AWS (Amazon Web Services).
- SNS is a pub/sub (publish/subscribe) messaging service that allows the delivery of messages or notifications to multiple recipients or subscribers.
- SNS can send messages or notifications to a wide range of endpoints, such as email, SMS, mobile push, HTTP endpoints, and other AWS services like Amazon SQS (Simple Queue Service) and AWS Lambda.
- SNS provides a low-cost infrastructure for mass delivery of messages, especially to mobile users.
- SNS enables the decoupling of microservices, distributed systems, and serverless applications using fully managed pub/sub.
- Publishers communicate asynchronously with subscribers by producing and sending a message to a topic, which is a logical access point and communication channel.
- Recipients subscribe to one or more “topics” within SNS.
Architecture diagram

Task details
- Sign into the AWS Management Console.
- Create an SNS Topic
- Subscribe to an SNS Topic
- Create an S3 bucket
- Update an SNS Topic Access Policy
- Create an S3 Event
- Testing the SNS Notification
- Validation of the lab
Launching the lab environment
- To launch the lab environment, click on the Launch lab button.
- Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
- Once the Lab is started, you will be provided with IAM username, Password, Access Key, and Secret Access Key
Lab guide
Lab steps
Task 1: Sign in to AWS Management Console
- Click on the Open console button, and you will get redirected to AWS Console in a new browser tab.
-
On the AWS sign-in page,
- Leave the Account ID as default. Never edit/remove the 12-digit Account ID present in the AWS Console. Otherwise, you cannot proceed with the lab.
- Now copy your UserName and Password in the Lab Console to the IAM Username and Password in AWS Console and click on the Sign-in button.
- Once Signed In to the AWS Management Console, make the default AWS Region as US East (N. Virginia) us-east-1.
If you face any issues, please go through FAQs and Troubleshooting.
#### Task 2: Create SNS Topic
- Make sure you are in the US East (N. Virginia) us-east-1 Region.
- Navigate to SNS by clicking on the Services menu available under the Application Integration section.
-
Click on Topics in left panel. Click Create topic

- Select the Type as Standard.
-
Under Details:
- Name : Enter mysnsnotification
-
Display name : Enter mysnsnotification

- Leave other options as default and click on Create topic.
-
An SNS topic is now created.

- Copy the ARN and save it for later.
Task 3: Subscribe to SNS Topic
In this task, we are going to subscribe an email address to the SNS Topic created in the previous task-
Once the SNS topic is created, scroll down below and click on Create Subscription

-
Under Details:
- Protocol : Select Email
- Endpoint : Enter <your Mail ID>
-
Leave other settings as default and click on create subscription.

- Note: Make sure you give a valid email address, as you will receive an SNS notification to this email address.
- Check your Spam box if you don’t see the email in your Inbox.
- You will receive an email confirming your subscription to your email.

- Click on Confirm subscription.

- Your email address is now subscribed to the SNS Topic mysnsnotification*.*
Task 4: Create an S3 Bucket
- Navigate to AWS S3 by clicking on Services in the top left corner. S3 is available under Storage.
-
In the S3 dashboard, click on the Create Bucket button and fill in the bucket details.

-
In the General Configuration:
- Select Bucket type : General purpose
- Bucket name: Enter mys3buckettestingsns-{yourname}
- Example : mys3buckettestingsns-sam (Note: The Bucket Name must be unique across all existing bucket names in Amazon S3)
-
Region: Select US East (N. Virginia) us-east-1 from dropdown.

- Object ownership: Select ACLs disabled (recommended) option
- Leave all other settings as default and click on Create bucket.
- Select the created bucket and click Copy ARN on the top. Save the ARN for later use.
Task 5: Update SNS Topic Access Policy
In this task, we are going to update the Access Policy of the SNS topic to enable it to send notification events based on S3 bucket event- Navigate back to the SNS page.
- Click on Topics.
- Click on mysnsnotification__.
- Click on Edit in the top right corner to edit the Access Policy of the SNS topic.
- Expand Access Policy.
- Update the SNS policy as shown below:
- Note: Here we need to update two things after pasting the below policy.
- Remove the old SNS policy and add the new policy to the SNS topic
- SNS Topic ARN in the Resources section below
- S3 bucket ARN in the Condition section below.
- Note: Make sure to update the bucket ARN and SNS topic in the above policy.
- Click on Save Changes.
- Now, your SNS topic has access to send notification events based on S3 bucket events.
Task 6: Create S3 Event
In this task, we are going to enable event notifications in the S3 bucket that was created in a previous step- Navigate back to the S3 page.
- Click on the S3 bucket that you have created in the above step.
- Go to the Properties tab and scroll down to Event notifications.
-
Click on Create event notification button.

- Event name : Enter myemaileventforput
-
Event types : Check PUT

- Under Destination, select SNS Topic
- Under SNS topic, select topic name created earlier.
-
Click on Save changes.

-
Note: If you are getting the below error, make sure to check that you have added PUT as condition above and completed Task 5 i.e. Updating the SNS Access Policy.

-
Now the S3 bucket has been enabled event notifications for putting new objects through our SNS topic.

Task 7: Testing the SNS Notification
In this task, we are going to test the setup of event notifications and verify that notifications are being sent successfully- Open your S3 bucket mys3buckettestingsns*.*
- In the bucket, under Objects, click on Upload
- Now click on Add Files and upload an image from your local system.
-
Once the image is successfully uploaded to the S3 bucket, click on Close. Now you can see the uploaded image under Objects.

- You have successfully received an SNS notification based on the PUT object event in S3 bucket.

- Go to your mailbox. You should have received an email from SNS.
Task 8: Validation Test
- Once the lab steps are completed, please click on the Check my work button on the right side panel.
- This will validate the resources in the AWS account and displays whether you have completed this lab successfully or not.
-
Sample output :

Completion and conclusion
- You have successfully used the AWS management console to create an Amazon SNS Topic.
- You have successfully subscribed to an SNS topic using your email address.
- You have successfully created an S3 bucket event to get SNS notifications sent to your email address.
End lab
- Sign out of AWS Account.
- You have successfully completed the lab.
- Once you have completed the steps, click on End lab in the IP Lab Portal.
What gets checked
When you press Check my work, the platform verifies each of these:- Create an Amazon SNS Topic — Check If SNS Topic created or not
- Create Private S3 bucket — Check whether a private S3 bucket is created or not
- check s3 object — Check whether an object is uploaded to the S3 bucket.