Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

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.

question from:https://stackoverflow.com/questions/65861686/amazon-cognito-uses-amazon-sns-server-location-with-low-spending-limit-instead-o

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...