AWS SNS SMS failing - amazon-web-services

I'm trying to send SMS via Amazon SNS, but since yesterday they are failing, I see a delivery rate of 0% in the AWS Console. As I understand, I would have to pay 29$ upfront to report a failing service.
Is there a possibility to get via CloudWatch the reason for the failed SMS service, or is there another method to complain to Amazon?

Since yesterday, the messages have completely stopped coming so you might have reached the SNS SMS spend limit for your account. By default it is 1 USD for a AWS account in a AWS region. You can check Delivery Status logs which might say 'No Quota Left for Account'.You should get your limit increased with limit increase case for which you do not have to pay 29 dollars.
But in future if you want to prevent this i.e. if you want to get notified earlier before you reach the actual SMS Spend Limit for your account so that limit can be increased before hand. In this way you would not face SMS delivery issues due to limit being reached. You can create a CloudWatch Alarm on your SMSMonthToDateSpentUSD metric.
Please have a look at this video: https://www.youtube.com/watch?v=5-HdLf_lizI

Related

Amazon Cognito uses Amazon SNS server location with low spending limit instead of location with high spending limit

I use SNS to send confirmation codes for signing up with Cognito.
Initially, it all worked great, with a $10 spending limit on us-east-1(N Virginia).
After some card issues, my spening limit got reduced to $1 and it was already reached.
After requesting a spending limit increase, Amazon increased my spending limit on Amazon SNS us-east-2(Ohio). My issue is that now Cognito tries to send messages using the Virginia server instead of the Ohio one, resulting in failed attempts.
I would like to switch SNS servers or maybe disable us-east-1 to fix this issue.
I'd appreciate any info on the matter.
Thanks in advance.
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-email-phone-verification.html
SMS messages from Amazon Cognito user pools are routed through Amazon
SNS in the same region unless noted in the following table.
There is no way to change this internal mapping. Ideally the easiest way is to increase the SNS spending limit in the us-east-1 region. Not sure why you got it in the us-east-2 region.. maybe you could explain further on that.
Another option is to use this new feature:
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html
It is a new Lambda trigger which is not available in the console but can be added in the CLI. You could use the AWS SDK to send the CODEs via SNS in the given region. I have not done this myself but should satisfy your usecase.

Variable Pricing for Amazon SNS SMS Notifications to Rest Of World (non-US) billing

As per AWS SNS documentation SMS text Transaction messages cost is in following link
https://aws.amazon.com/sns/faqs/#SMS_pricing
https://aws.amazon.com/sns/sms-pricing/
Now when i can see my bill found SMS cost is very high on AWS found AWS has "Variable Pricing for Amazon SNS SMS Notifications to Rest Of World (non-US)"
https://www.devconinc.com/pricing/GSA-IT-Schedule-70/cloud/US-AmazonSNS.htm
When this cost will be applicable and how to avoid this "Variable Pricing for Amazon SNS SMS Notifications to Rest Of World (non-US)" ?
These pricing is only indicative. https://aws.amazon.com/sns/sms-pricing/
The prices below are provided for guidance only, and change frequently.
Why is the price not fixed?
AWS has to contract this service to a telecom service provider. The pricing of which is based on agreements between international companies (ie the telecom giants). You see for example, in my country, the telecom provider makes promotions and discounts. There are promotions that run for a short period (ie a day), and a long period (ie years or since their inception!). As per their T&C, they can change the price with a short notice or even without notice.
When will this cost apply?
If you send a SMS massage, you are charged SMS fees.
On top of that, you are charged Amazon SNS fees (if you are outside the free tier)
How to embrace SMS charges?
The way you did it was correct... send a message, wait 24 hours, check your usage... then plan accordingly
https://docs.aws.amazon.com/sns/latest/dg/sms_stats_usage.html
It takes 24 hours for the SMS usage report to be available in the S3 bucket.
If you decided to use this service, keep monitoring for price change regularly.... so you adapt your plan
What are other options?
SMS is only one option in SNS. SMS can only be sent through telecom companies (both sending and receiving). It is very costly to run a telecom company for the compliance and regulatory matters they have to deal with. Tell me how much it costs to run a webserver, in contrary. Emails and mobile-app-push are sent through servers... virtually there is no regulatory body.
I suggest you communicate with your users through the means that are inline with your/their expectations. If you decide so, then someone has to pay for SMS.
No wonder, emails and mobile-app-push became more common!

Will an Ubuntu instance monitoring a website every minute exceed the AWS Free Tier

I have started an Ubuntu EC2 free tier server. It has one purpose - to monitor a different server. It runs a cron job every minute which performs a ping and a curl request to one server.
The purpose is if the ping result is 0 or the curl response http code is faulty it then sends an email using SES to various people.
My question is, will this action occurring every minute eventually exceed the free tier allowed usage per month?
Yes it will, the free tier is not free forever and it is free only for 744 hours for 12 months. Bear in mind that this is applicable for your account, which means if you have 2 free tier instance the free hours are consumed not individually but collectively.
IMO, it is an overkill to run an ec2 instance 24 hours a day when it is not used the whole time.
Better solution design for this problem will be to create a lambda and a cloudwatch schedule triggers. You will pay for the compute that you need and not waste by claiming it all the time. Also, the AWS Lambda free usage tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month.
You could Create an Amazon RouteĀ 53 Health Check and have it check the endpoint for you. If a check fails, this is reported in Amazon CloudWatch.
You could then configure a CloudWatch alarm to activate when the health check fails, and it can send a message to an Amazon SNS topic. You could subscribe people to the topic to receive notification that the health check failed.
All up, it should cost a couple of dollars per month.

AWS notification on exceeding limit

I just started using AWS services. I want to receive notifications if any service usage exceeds limit. After searching for the options I found that same can be achieved suing AWS Cloudwatch alarm and AWS Limit Monitor using AWS CloudFormation. My question is, will i be charged if i use these services to receive notifications?
Yes, you can setup all kinds of notifications to keep a handle on what you are being billed, but that doesn't stop you from actually getting billed if you exceed your limits.
For example I have alerts to notify me when I reach 25%, 50%, 75% and 100% of my typical monthly spend - so I roughly should get one notification each week - but a lot can happen between when you get sent the notification, and when you take action - especially if, for example, someone got access to your account and started crypto-mining on some big ec2 instances.

AWS SNS workaround for 100,000 topics limit

I am developing an architecture for push notifications using AWS SNS with APNS and GCM. The model that I am following is
Each user (not device) will have an SNS topic corresponding to it
Each user can have multiple devices
Create an platform application endpoint for each device
Subscribe the platform application endpoint to the topic belonging to the device's user
This way, when we have to send a notification to all the devices of a user, we need to call the publish method using the user's topicArn and all its devices should get the message.
However, by default AWS has a limit of 100,000 topics. If we are anticipating higher number of users like 1 million or say 10 million to be optimistic, is there any workaround for this approach?
Should I ask AWS to raise the limit beforehand? Do they raise limit to a number like 100 million easily? Is there any cost implication of most of them are not used in the beginning few months?
disclosure: I used to work on Amazon SNS
The architecture you propose is a common pattern within Amazon SNS and is sound.
You should ask for a topic limit increase. There is no cost implication for having a higher topic limit, even if you create the topics and don't use them. However, you will pay $0.50/million requests for each CreateTopic call, with the first 1 million requests being free per month.
When you submit the support ticket, please document your use case. It helps the team expedite your limit increase request.
We followed a similar model to OP's with one exception - as the number of users grew, so did the number of dead accounts. Face it, user retention poses a challenge. So you may want to come up with a topic recycling strategy. Hint: Don't permanently bind a topic to a user but allow ARNs to expire, similar to a DHCP lease. Your app may periodically ask your web service what ARN it needs to subscribe to and expect to be re-assigned. If you build this into the client protocol early on, you won't need as many ARNs. After all, 100k active users is entirely different than 100k enrolled users :)
With Amazon SNS, there is no minimum fee and you pay only for what you use. Users pay $0.50 per 1 million Amazon SNS Requests, $0.06 per 100,000 Notification deliveries over HTTP, $0.75 per 100 Notification deliveries over SMS and $2.00 per 100,000 Notification deliveries over Email.
Amazon SNS also includes a Free Tier, where users can get started with Amazon SNS for free. Each month, Amazon SNS customers pay no charges for the first 1 million Amazon SNS Requests, no charges for the first 100,000 Notifications over HTTP, no charges for the first 100 Notifications over SMS and no charges for the first 1,000 Notifications over Email.
So I will suggest increase the limit before hand if that is anticipated by you. you don't get charged for increasing the limits. They will definitely increase to 100 Million.