问题描述
我想建立一个基本的SNS订阅,但它看起来像AWS永远不会发送的确认,或者通过控制台或使用SDK。
步骤我已到目前为止:
- 在我已经建立了使用AWS控制台一个主题
- 我同时使用AWS控制台和红宝石SDK 添加HTTP订阅既是ngrok隧道网址,也是一个公共的Web服务器的URL
- 我已经让大家通过编辑主题策略中的AWS控制台订阅主题
通过拖尾两个我的本地和公共Web服务器日志,我可以看到没有请求过发送到端点。
我是pretty的位置难倒,因为它看起来像它绝对应该工作,或至少送点东西(什么)我的终点?
在code我使用的红宝石SDK如下:
SNS = AWS :: SNS.new(access_key_id:ENV ['AWS_ACCESS_KEY_ID'],secret_access_key:ENV ['AWS_SECRET_ACCESS_KEY'])
#我只有一个主题
话题= sns.topics.first
topic.subscribe(URI.parse('的http://< NGROK_URL> .ngrok.com /通知/通知))
topic.subscriptions.first
#返回:=> < AWS :: SNS ::认购ARN:PendingConfirmation>
这竟然是与我的工作在该地区的一个问题。我换到俄勒冈州和所有确认立即发送。
必须有一定的权限从某些地区发送的任何消息都设置在什么地方prevents你,但它默默地失败。
I am trying to set up a basic SNS subscription but it looks like AWS never sends the confirmation, either through the console or using the SDK.
Steps I have taken so far:
- I have set up a Topic using the AWS console
- I have added HTTP subscriptions to both an ngrok tunnel URL and also a public web server URL using both the AWS console and the ruby SDK
- I have allowed everyone to subscribe to the Topic by editing the Topic policy in the AWS console
By tailing the logs on both my localhost and public web servers I can see that no request is ever sent to the endpoint.
I'm pretty stumped here because it seems like it should definitely be working, or at least sending something (anything) to my endpoints?
The code I'm using for the ruby sdk is as follows:
sns = AWS::SNS.new(access_key_id: ENV['AWS_ACCESS_KEY_ID'], secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'])
# I only have one topic
topic = sns.topics.first
topic.subscribe(URI.parse('http://<NGROK_URL>.ngrok.com/notifications/notify'))
topic.subscriptions.first
# returns: => <AWS::SNS::Subscription arn:PendingConfirmation>
This turned out to be an issue related to the region I was working in. I changed to Oregon and all confirmations are sending immediately.
There must be some permissions setting somewhere that prevents you from sending any messages at all from certain regions, but it was failing silently.
这篇关于AWS SNS不发送订阅确认对HTTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!