It looks like AWS does not provide SMS as a protocol for SNS topic subscribers outside of US East. I wanted to hook up my CloudWatch alarms and receive text messages when something breaks but cannot send them to SMS.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Outside of us-east-1 you will not find any protocol like SMS in the protocols dropdown
AWS is not providing a proper solution but you can do some hacks for this
To implement this Solution I am using AWS Lambda but if you are having some HTTP endpoint(any sort of API) then you can also use it, the basic steps are same.
Hope this helps, and please comment if there is some doubt on the above procedure.
YES!
After some digging I was able to get this to work. It's a little more complicated than just selecting a topic or inputing an alarm but it works great!
The key to the solution was using AWS's lambda functions!
The flow of data is such:
Just the services:
I won't talk too much about setting up SNS or setting up lambda, you can go through the examples that already exist for that. However, I will share the lambda code that I wrote to perform this. You can test it by using the publish message to topic functionality.
This doesn't require any additional libraries other than the aws-sdk that is already in the lambda function. You can feel free to leave out the console logging if you don't want it but it was useful for debugging.
If you use there test functionality, it will likely fail. I believe this is because the callback never happens.
Remember that the lambda should not be on us-east-1 since it will be triggered on whatever region you are using.
Links to tutorials:
SNS Publish api:
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SNS.html#publish-property
How to node.js in lambda:
http://docs.aws.amazon.com/lambda/latest/dg/programming-model.html
A really great tutorial on using other aws functions:
http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
Here's a more modern/concise similar solution leveraging the new Node 8.10 an environment variable: