AWS SNS dynamic subscriptions - amazon-web-services

We have got a strange requirement and we would like to send SMS to our clients based on the assets they are monitoring. Each asset can have 100s of subscribers and there are 1000s of assets so obviously, we can not create one SNS topic per asset. We have the assets and their list of subscribers in a RDS instance on AWS.
Is there anyway with SNS to make the list of its subscribers dynamic, each time we publish a message to it we also supply the list of subscriber this message should be sent to? What are my other options or another AWS service? Lambda maybe? Please advise. thanks

I finally used SNS for this purpose. Each time I need to sent an alert, I call a lambda and supple lambda with the list of subscribers and the message for that asset. Lambda will go ahead, create a new topic, add the subscribers to it, publish the message to it and when everything is done, removes the topic. Works great.

AWS SNS for sending sms had limitation like only for US or North America region. This point should be double checked before making such choice. If your users only from USA - so quite good. In other cases I would recommend to take a look on https://www.nexmo.com/, clickatell.com or Twilio. They provide nice API and can be managed very easy.

Related

Unable to add sender ID to AWS SNS text messages

I live in India and I have this requirement where I need to change the default sender Id of text messages sent via AWS SNS to the one that is registered for our organization with TRAI. We are trying to send SMS text messages to customers with Indian mobile numbers. I tried passing TemplateID and EntityId that was issued to us by our provider on the AWS console to manually test things out by unfortunately, whenever I receive text message on my mobile, the sender name still shows a random number assigned by AWS and not the sender id that I configured. I also made sure that the template message approved by TRAI is exactly the same but it did not work either. There are no error logs on AWS either because the message was successfully delivered. Its just that the sender id is not the one that I had configured it to be.
Any help on this topic would be much appreciated. Thanks in advance!
P.S. We registered our template on JIO which is a Telecom provider here in India.
You can't use AWS SNS for this. You have to use AWS Pinpoint if you want to use your specific number. With Pinpoint you can also use short-codes and long-codes and can also configure your messages to be promotional or transactional. You can set your sender id in AWS pinpoint as well. Check the documentation below on how to do that.
https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-awssupport-sender-id.html
It doesn't matter if you have any registration with any telco providers as AWS will use it's own infra to send the messages. So you either have to use 100% AWS solution or 100% telco provider services. You can't mix and match both for SMS sending use-case.
UPDATE:
Well SNS and Pinpoint are 2 different services for 2 different use cases. SNS is only for "notifications" and Pinpoint is like a communication service.
As far as sender-id in SNS is concerned, some countries require it as a hard requirement. You can read more about it in the documentation below:
https://docs.aws.amazon.com/sns/latest/dg/channels-sms-awssupport-sender-id.html
AWS SNS does support using sender IDs together with template and entity IDs for targeting India. If you follow the instructions at https://docs.aws.amazon.com/sns/latest/dg/channels-sms-senderid-india.html, you'll be able to do this.

Ip or iam user from which Publish message request made to sns topic?

I have a lambda function that is invoking around 60million times from one sns topic, in the sns topic metrics i could see it is publish around 600k msgs but I wanted to know how we can check which iam user has made the publish message request in that topic and how can we get the IP from which message are published?
As for as I know there is no way you can monitor what you are asking for. What you can do is to search ClouTrail logs and figure out yourself which user made how many requests to sns. There is also a way to put the logs(CloudTrail) in CloudWatch but it's not cheap process. If you are interested, you check this.

Amazon Pinpoint vs. Amazon SES/SMS

I would like to send a verification code to a specific user (only one) via email or text message. I have successfully done so through Amazon SES but I have not attempted through Amazon SMS yet. I have found myself going down the rabbit hole of investigating AWS Pinpoint.
It seems to me Pinpoint is meant for mass user messaging (text/email) rather than one-of individual messaging. I'm hoping I gathered that correctly.
My question, is there an advantage/disadvantage of using Pinpoint over Amazon SES and SMS for my use case?
This may be addressed by the Pinpoint FAQ
Q: I already use Amazon SNS or Amazon SES. What do I gain by switching
to Amazon Pinpoint?
In typical Amazon SNS and Amazon SES use cases, you have to set up
your application to manage each message's audience, content, and
delivery schedule. These same features are built in to Amazon
Pinpoint. With Amazon Pinpoint, you can create message templates,
delivery schedules, highly-targeted segments, and full campaigns.
Pinpoint also appears to be able to push notifications to users through the users preferred contact mechanism. This means that you are not limited to SMS and you reach your users with activation codes through the means they want to be reached. It also allows two-way communication.
The Pinpoint homepage also says:
You can send direct messages—such as order confirmations, welcome
messages, and one-time passwords—using the console or the Amazon
Pinpoint REST API. You can also use the API to build custom
applications that deliver campaign and transactional messages across
multiple channels.
This suggest it is suitable for your uses, though it has additional mass-communication features you do not currently need.
In addition to above points mentioned by #Freiheit you can send and receive SMS messages through Amazon Pinpoint. This will help you to track user response and create surveys, reviews and quiz like scenarios.
Check this AWS Documentation link

AWS SNS Mobile Push based on user notification preferences

I'm working SNS Push notifications into an app that I'm building, and I'm wondering how to handle user notification settings? What I don't understand is if SNS provides a way to manage a user who wants to receive notification type "A", but not type "B". A more real-world correlation is managing a Facebook user who wants notifications for comments, but not likes. Does SNS provide an easy way to manage this?
I can manage it myself through my own servers/databases, but this seems like something that SNS should be able to do.
I would suggest each notification type is a different SNS topic. That way the user can control each topic he is subscribed too. That puts more work for you in your app but this way you get to your designed goal of allowing each user to subscribe to each a different type of notification.
Topics are free but SNS messages sent are charged.
FREE TIER: Each month, Amazon SNS customers receive 1,000,000 Amazon SNS Requests, 100,000 HTTP notifications, 1,000 email notifications and 100 SMS notifications for free.
Cost calculator: http://calculator.s3.amazonaws.com/index.html
SNS Pricing Details: https://aws.amazon.com/sns/pricing/
No. SNS does not provide a way to manage users to subscribe based on notification types
In fact there is no implicit notification type definitions. Although you can have that as part of your payload.
So you can either
Have different topics for different notification types and then attach subscribers based on which type of messages they are interested in
Have a type definition defined within the payload and then let the filtering happen at the subscribers. But keep in mind that this will be costly affair because all subscribers receive all notifications and you can soon exhaust your free limit. Also the subscribers will receive unnecessary load

How can I see a report of my AWS Bounced emails?

I have an application that automatically sends thousands of emails per hour using Amazon Web Service's Simple Email System (SES).
How/where can I view a report of email bounces?
EDIT:
Below #Neil shows how I can setup SNS to email me about bounced emails. But is there any way I can see a report of Bounced emails in the past? Going forward is there a way I can see a bounce report/table instead of getting an email notification every time an email bounces?
It has been long time wanted but there's no built-in feature for now.
I suggest you push on this thread so Amazon gives more info about the roadmap to integrate this feature
You can configure AWS to email you via SNS. See here
You can configure SES to send bounces (and complaints, and even deliveries) to an SNS endpoint.
From SNS, you can configure different subscribers: email, http(s), or a couple other options. The interesting option is Lambda. Create a Lambda end point, and then write a simple function that inserts the information you want to track into DynamoDB.
This might cost you a few cents/month, but you have control over what you're recording and how to access it.