DEV Community

Natyy
Natyy

Posted on

Learn how to send SNS AWS message in 10 minutes

Here's a 10-minute tutorial on how to send a message using Amazon SNS (Simple Notification Service).
SNS is a flexible and scalable messaging and notification service that allows you to send messages through different channels, such as email, SMS, HTTP/S and more.

Step 1: Configuring Amazon SNS

a. Log in to the Amazon SNS console in your AWS (Amazon Web Services) account.

Image description

b. Create a new topic in SNS. This will act as a channel for sending and receiving messages.

Image description

Image description

c. Once the topic is created, write down the topic's ARN. The ARN is a unique identifier that you will need later to post messages to that topic.

Image description

Step 2: Creation of a subscription

a. Within the topic you created, click on "Create subscription".

Image description

b. Select the protocol through which you wish to receive the messages, for example, email, text message (SMS), etc. In our case we selected SMS.

Image description

c. Enter the necessary details for the selected protocol, such as e-mail address or telephone number.
d. Confirm the subscription by following the instructions provided on the chosen platform. For example, if you selected email, check your inbox and follow the confirmation link sent by SNS.

Image description

Step 3: Sending a message

a. Go back to the main page of the topic in the SNS console.
b. Click on "Post a message".

Image description

c. In the "Message" field, enter the content of the message you wish to send.

Image description

d. Click on "Publish message".

Image description

You should receive something like this in your messenger service.

Image description

You're done! You have sent a message using Amazon SNS. The message will be delivered to all subscriptions configured for that topic. You can add more subscriptions as you need and send messages through different channels.
Remember that there are advanced configuration options in SNS, such as customizing messages, filtering subscriptions, and handling delivery confirmations and notifications. You can explore the official Amazon SNS documentation for more details on these additional features.
I hope you found this tutorial helpful. If you have any additional questions, feel free to ask.

Top comments (0)