Amazon SNS -- Change Sender ID - amazon-web-services

I want to use Amazon SNS Services to send SMS to a couple of numbers. I have a cronjob that's running once a day and should send a SMS to the numbers which are due in that moment.
Now I have a couple of question regarding SNS.
Do I create a topic with each run of my cronjob, subscribe the numbers to it, send it, and delete it? Or do I just create a topic in the console and then I just subscribe the numbers, send the message and unsubscribe the numbers again after sending?
Further I tried something simple with suppling my ARN and send a message with the content's "Hello World!". The message which was received on my cell was coming from "NOTICE" and had the contents:
FPREMINDER> Hello World!
Now I have two questions:
FPREMINDER is my display name of my topic. But why is it included in the messsage?
And how can I change the "NOTICE" to a custom name and a custom number in case somebody replies?
Thanks for any help!

If you are consistently sending messages to the same set of recipients, then the logical process would be to define the topic once, add subscribers and then simply send the message to the topic each day.
If you wish to maintain your own list of subscribers, where people can add/remove themselves throughout the day, then use the features of Amazon SNS that let you send SMS messages directly, without going via a subscription.
From Setting SMS Messaging Preferences:
For Default sender ID, type a custom ID that contains up to 11 alphanumeric characters, including at least one letter and no spaces. The sender ID is displayed as the message sender on the receiving device. For example, you can use your business brand to make the message source easier to recognize.
Support for sender IDs varies by country. For example, messages delivered to U.S. phone numbers will not display the sender ID. For the countries that support sender IDs, see Supported Regions and Countries.
If you do not specify a sender ID, the message will display a long code as the sender ID in supported countries. For countries that require an alphabetic sender ID, the message displays NOTICE as the sender ID.
You can override the this setting when you send a message.
From Sending an SMS Message:
When you send a message, you can control whether the message is optimized for cost or reliable delivery, and you can specify a sender ID.
...
AWS.SNS.SMS.SenderID
A custom ID that contains up to 11 alphanumeric characters, including at least one letter and no spaces. The sender ID is displayed as the message sender on the receiving device. For example, you can use your business brand to make the message source easier to recognize.
Support for sender IDs varies by country. For example, messages delivered to U.S. phone numbers will not display the sender ID. For the countries that support sender IDs, see Supported Regions and Countries.
If you do not specify a sender ID, the message will display a long code as the sender ID in supported countries. For countries that require an alphabetic sender ID, the message displays NOTICE as the sender ID.
This message-level attribute overrides the account-level attribute DefaultSenderID, which you set by using the SetSMSAttributes request.

you can also change this for all messages in the text messages preferences
But pay attention, not every region has a SMS Service, have a look here

Related

GCP PubSub understanding filters

In my understanding PubSub filters are supposed to reduce number of messages sent to a specific subscription. We currently observe behaviour that we didn't expect.
Assuming there is a PubSub Topic "XYZ" and a subscription to that topic "XYZ-Sub" with a filter attributes.someHeader = "x"
There are 2 messages published to that topic:
First one attributes.someHeader = "a". Second one with attributes.someHeader = "x"
I expect the only message 2 will be delivered to the subscription as message 1 does not match the filter.
If it is not the case and still both messages get delivered (what we currently observe):
GCP console shows a rising number of unacked messages on a sub when no client is connected. Pulling this messages in the gcp console removes them without showing any received messages, which makes me assume that the filters are applied when pulling messages.
Are filters evaluated on PubSub client and not topic level?
What is the point in using filters with pub/sub?
Will the delivery of the unwanted message (the bytes of the message) be billed?
Filtering in Cloud Pub/Sub only delivers messages that match the filter to subscribers. The filters are applied in the Pub/Sub service itself, not in the client. They allow you to limit the set of messages delivered to subscribers when the subscriber only wants to process a subset of the messages.
In your example, only the message with attributes.someHeader = "x" should be delivered. However, note that as the documentation, the backlog metrics might include messages that don't match the filter. Such messages will not be delivered to subscribers, but may still show up in the backlog metrics for a time.
You do get charged the Pub/Sub message delivery price for messages that were not delivered. However, you do not pay any network fees for them, nor do you end up paying for any compute to process messages you do not receive.

Google Cloud Pub/Sub retrieve message by ID

Problem: My use case is I want to publish thousends of messages to Google Cloud Pub/Sub with a 5min retention period but only retrieve specific messages by their ID - So a cloud function will retrieve one message by ID using the Nodejs SDK and all the untreated messages will be deleted by the retention policy. All the current examples mention are to handle random messages from the subscriber.
Is it possible to just pull 1 message by id or any other metadata and close the connection.
There is no way to retrieve individual messages by ID, no. It doesn't really fit into the expected use cases for Cloud Pub/Sub where the publishers and subscribers are meant to be decoupled, meaning the subscriber inherently doesn't know the message IDs prior to receiving the messages.
You may instead want to transmit the messages via whatever mechanism you are using to making the subscribers aware of the message IDs. Or, if you know at publish time which messages will ultimately need to be retrieved, you could add an attribute to the message to indicate this and use filtering.

Do I have to change to AWS Pinpoint to use 10DLC for sending SMS messages or can I still use AWS SNS

Brief Description:
What is an unregistered long code when it comes to an application sending SMS messages?
Plus, I'm using AWS SNS to send text messages through a node js application. Do I have to switch to Amazon Pinpoint to send to SMS messages?
Detailed:
I got an email from AWS saying that the US telecom carriers would no longer support sending Application-To-Person (A2P) SMS messages over unregistered long codes
It then says If you are using long codes, Amazon strongly recommends that you complete the transition to toll free numbers, 10DLC, or short codes.
In addition to that it appears that AWS wants me to use Amazon Pinpoint to send sms messages and email. And the deadline to make the change is on June 1, 2021.
First off, whats an unregistered long code? I imagine those are the long international phone #'s you'd see for someone in Europe or Latin America. But to be sure I looked at AWS's docs and don't really see an example of one.
I have a node app running on an EC2 instance that uses AWS SNS to send messages to US text messages based off certain business logic. The phone numbers in the config files have the following format: US Country Code - 10 Digit phone Number so an example is +13215441222 which is a 10DLC plus the us country code.
In other words, my app is already sending text messages using 10DLC but its doing so using AWS SNS. So do I even have to do anything that the AWS email recommends?
I don't have aws support to ask them this question so I'm asking it here.
In addition to that it appears that AWS wants me to use Amazon Pinpoint to send sms messages and email.
You can still use SNS to send SMS messages, either using 10DLC, short codes or toll-free.
First off, whats an unregistered long code?
It is any number used in application-to-person (A2P) SMS messaging not registered with The Campaign Registry (TCR)
Let me quote documentation:
In order to use a 10DLC number, first register your company and create a 10DLC campaign using the Amazon Pinpoint (not Amazon SNS) console. AWS shares this information with The Campaign Registry, a third party that approves or rejects your registration based on the information. In some cases, registration occurs immediately. For example, if you've previously registered with The Campaign Registry, they might already have your information. However, some campaigns might take one week or longer for approval. After your company and 10DLC campaign are approved, you can purchase a 10DLC number and associate it with your campaign. Requesting a 10DLC might also take up to a week for approval. Although you can associate multiple 10DLCs with a single campaign, you can't use the same 10DLC across multiple campaigns. For each campaign you create, you need to have a unique 10DLC.
Reference: https://docs.aws.amazon.com/sns/latest/dg/channels-sms-originating-identities-10dlc.html
So do I even have to do anything that the AWS email recommends?
Yes, you need to switch to 10DLC, toll-free or short codes.
Short codes reference: https://docs.aws.amazon.com/sns/latest/dg/channels-sms-originating-identities-short-codes.html
Blog post about 10DLC: https://aws.amazon.com/blogs/compute/provisioning-and-using-10dlc-origination-numbers-with-amazon-sns/

AWS SES - Bounced emails

I will try to express my question, I'm sorry if is not the correct way to do it.
I have an AWS SES configured to receive emails from my customers, sometimes the client get in a list and try to send an email too large (above 10MB), and my costumer start to receive bounced emails from all recipients in that list.
The bounce happens when my client tries to send an email for another people but the email of my company appears on CC field.
E.g:
the client sent an email:
TO: wherever#google.com
CC: mycompany#mycompany.com (this one will be sent for my SES); [a lot of other emails.........list]
This mail will be more large than 10MB (my SES must have to treat it).
This chain wil generate an bounced mail for my costumer, once that my email appears on CC list.
It's a little bit complex to express, but basicaly is it.
I'd like to know if is possible to track this attempts when the costumer receive the first bounce email from AWS. and to trigger a alert for me that the costumer is getting in a bounced list.
You can absolutely do this, SES supports notifications per type to SNS. The types are Delivery, Bounce, Complaint.
Each type can be registered to an SNS topic which you can subscribe a Lambda function to.
This Lambda function can then perform any logical decisions that you would like for your workflow.
In addition you can subscribe any email addresses you want to receive the raw notification that it was undelivered, although you will need to confirm there subscriptions before they can receive notifications. This would be ideal for a support inbox for example.
The AWS documentation contains more information about notifications

Send SMS with custom sender id using amazon notification service

Iam using amazon notification service for sending SMS. i successfully got the message to my number. i have updated the sender id using aws console like this.
But i got SMS like this
from : VK-NOTICE
Body : test message
from id is diifrent. why? is it possible to change sender id ?
According to TRAI length of sender id in transactional sms should be 6 in India and yours is 5 (MANAF) that's why it is changing it to default. To use your sender id in transactional sms use id with character length of 6. Ex(AbdulM)
Note: It only works with transactional Sms.
AWS Docs have the answer here:
For Default sender ID, type a custom ID that contains up to 11 alphanumeric characters, including at least one letter and no spaces.
The sender ID is displayed as the message sender on the receiving
device. For example, you can use your business brand to make the
message source easier to recognize.
Support for sender IDs varies by country. For example, messages
delivered to U.S. phone numbers will not display the sender ID. For
the countries that support sender IDs, see Supported Regions and
Countries.
If you do not specify a sender ID, the message will display a long
code as the sender ID in supported countries. For countries that
require an alphabetic sender ID, the message displays NOTICE as the
sender ID.
You can override the this setting when you send a message.
You should try https://www.twilio.com/
As on 2 Nov 2018, Custom sender ID is not supported for India. See below link for current supported countries.
AWS SNS Supported Countries