How to Setup Amazon SNS 2021.
We all receive many notifications on our devices in text or electronic form. These notifications are messages that inform us about product offers, delivery statuses, upcoming invoices, 2FA codes, etc.
All such notifications use a notification service, and Amazon SNS (Notification Submission Service) is one of them. Amazon SNS is a fast, flexible, and fully managed push notification service that coordinates the delivery of messages to subscription endpoints.
Some of the features that make Amazon SNS a popular notification service are:
- SNS allows you to send both single messages and forked messages to a large number of recipients.
- It meets publish-to-subscribe messaging criteria when a notification is delivered to a client using a push mechanism, eliminating the need to regularly check for new updates.
- To avoid losing messages, messages are published to Amazon SNS and stored in multiple zones for availability.
- It allows multiple recipients to be grouped together using a logical access point to deliver identical copies of messages to subscribers.
Setting-up Amazon SNS
Setting up Amazon SNS begins with creating an AWS account. After the account is created, the following privileges are available:
First, you will need to assign the IAM roles. IAM roles are assigned to specific users that define the set of permissions for making requests for AWS services. To create an IAM (Identity and Access Management) user, you need to have your AWS account credentials.
Using an IAM administrator account with Amazon SNS is not a good practice. Better to create a separate IAM user for each individual who needs administrative access to Amazon SNS.
To use Amazon SNS, you need to have a policy called AmazonSNSFullAccess and AWS credentials associated with your IAM user. The credential information will include the key ID and the secret key for access.
The steps to create an AWS account are shown below:
STEP 1. Go to the AWS home page, select the Create AWS Account option and follow the instructions to complete the registration process.
STEP 2. Open the AWS Identity and Access Management console and log in as root with your email address and password to create an IAM account. Root users of an AWS account have access to all resources across all AWS services.
STEP 3. After logging into your account, enter â€œIAMâ€ in the search tab to access the IAM service and then press â€œEnterâ€.
STEP 4. Select the “Users” option on the left side of the toolbar and click the “Add User” button.
You will be redirected to the next page where you will need to provide your username.
After that, select the type of access to AWS, ie, do you want programmatic access, access to the AWS Management Console, or both.
Set an auto-generated or custom password for your console. Note that this option will only appear if you have selected AWS Management Console Access, or both AWS Management Console Access and Programmatic Access.
Note. If you selected programmatic access only, then the passkey ID and secret passkey must be generated in a .csv file that can be used in the CLI console.
Check the box next to the password reset option and click the Next Resolution button.
STEP 5: To set permissions, click the Add User to Group button and click the Create Group button.
Note: You can also copy and add the permissions of an existing user to another user, or simply create and attach new policies to users using the option to attach existing policies directly .
The panel for creating a group will open. Enter the name of the group, click the New Policy button and enter SNS in the search bar of the policy filter. The name of the policy indicates its type, use, and description. Your group will be created with assigned policies. Click on the “Next” tag.
STEP 6: The add tags panel will open where you need to add a key and value (optional). Click on the Next tag. Review the details of the users to be “added”, a summary of permissions, and associated tags. Click on the “Create User” button.
STEP 7: Successful, the user has been added to the group with permission policies. Download the .csv to secure your credentials and click the close button.
Your IAM user was created in this step. Now let’s get ready to work with Amazon SNS. Follow these steps to create a topic, subscribe to a topic, and post a message.
Step 1. Create a theme
By default, the console creates a FIFO (first-in, first-out) topic that delivers exactly one message in a strictly preserved order, or you can also choose the Standard option, as this is the best option for delivering messages with maximum throughput. Click Create Topic.
There are also additional services that you can add to your theme.
Encryption – You can enable server-side topic encryption, although Amazon SNS sends messages encrypted by default.
Access Policy – This allows you to define who can access a topic. By default, a topic owner can also subscribe or publish a topic.
Retry Delivery Policy. Sometimes Amazon SNS retries fail to deliver the message to the endpoints, so to change the default setting, you can enable this service to increase retries.
Delivery Status Logging – With this option you can get a better understanding of how it works. You can easily track the delivery of messages and detect the response sent to them from the Amazon SNS endpoint.
Tags – This option allows you to add or remove the Amazon SNS topic metadata tag. Tags are used to track costs, filter, and search topics.
Step 2. Create a subscription to the topic
Check your inbox to confirm your subscription from AWS SNS. If you open Amazon SNS in a web browser, a confirmation of your subscription ID is displayed.
Step 3. Publish the message of the created topic
How to Setup Amazon SNS 2021
- View usage reports
- View activity reports
- Access and Authentication Management
- Programmatic access: This allows you to perform actions on AWS resources either through a third-party tool or through an application.
- AWS Management Console Access: Provides easy access and a secure web portal to manage the services of your AWS account.
- Sign in to the Amazon SNS console using your IAM credentials. In the New Topic panel, enter a name for the topic and click the Next Step button.
- The theme creation console will open and you will need to enter information into it.
On the navigation bar, click the Subscribe button.
- The new subscription page will open with details. Select an ARN (Application Reference Number) topic to check the list of topics in your AWS account.
- In the “Protocol” field, select “Email”, “SMS” or any of the options according to your requirements. Define an endpoint by entering an email address (if an email address is selected) to send notifications to that endpoint. Click on “Create subscription”.
- The created subscription will be opened with full details.
- Select a theme option in the navigation bar.
- The theme console will open, select the theme you created and click the “Post message” button. Enter your message details and enter a subject.
- How to Setup Amazon SNS 2021