Amazon SNS订阅确认的方法以及订阅确认的POST请求将被发送到哪里。

huangapple go评论86阅读模式
英文:

how to do amazon SNS subscription confirmation and where it will sent the post request of subscription confirmation

问题

我创建了一个Amazon SNS主题并添加了HTTPS订阅。
我的问题是如何确认订阅。

问题现在是我不知道如何确认HTTPS URL的订阅。我看不到它发送请求的POST请求。我正在使用JavaScript通过Lambda函数调用此SNS主题。有人可以帮助我吗?
谢谢...

英文:

I created an Amazon SNS Topic and added https subscription.
my problems are how to confirm the subscription.

The problem now is I cannot understand how to confirm the subscription for the HTTPS URL. I cannot see the post request where it is sending request. I am invoking this SNS topic by lambda function using javascript. can someone please help me to do it.
Thank you...

答案1

得分: 0

从AWS文档中提取的内容:

> 订阅您的端点后,Amazon SNS会向端点发送确认订阅消息。端点上的代码必须从订阅确认消息中检索SubscribeURL,然后要么访问SubscribeURL指定的位置,要么使其可供您手动访问SubscribeURL,例如,使用Web浏览器。

> Amazon SNS在确认订阅之前不会向端点发送消息。当您访问SubscribeURL时,响应包含一个XML文档,其中包含指定订阅的ARN的元素SubscriptionArn。

> 您还可以使用Amazon SNS控制台来验证订阅是否已确认:订阅ID显示订阅的ARN,而不是您首次添加订阅时的PendingConfirmation值。

要确认SNS订阅,您可以执行以下步骤:

  • 在CloudWatch中记录完整的SNS事件,这将允许您访问SubscribeURL

C#

_logger.LogInformation(JsonConvert.SerializeObject(event));

nodejs

console.info(JSON.stringify(event, null, 2))
  • 在记录的事件中识别SubscribeURL的端点
  • 手动访问Web浏览器中的SubscribeURL链接以确认订阅
英文:

From AWS documentation

> After you subscribe your endpoint, Amazon SNS sends a subscription
> confirmation message to the endpoint. The code at the endpoint must
> retrieve the SubscribeURL from the subscription confirmation message
> and then either visit the location specified by the SubscribeURL or
> make it available to you so that you can manually visit the
> SubscribeURL, for example, using a web browser.
>
> Amazon SNS doesn't send messages to an endpoint until the subscription
> is confirmed. When you visit the SubscribeURL, the response contains
> an XML document which, in turn, contains the element SubscriptionArn
> that specifies the ARN for the subscription.
>
> You can also use the Amazon SNS console to verify that the
> subscription is confirmed: The Subscription ID displays the ARN for
> the subscription instead of the PendingConfirmation value from the
> time when you first added the subscription.

To confirm the SNS subscription, you can perform the following steps:

  • Log the complete SNS event in CloudWatch, which will allow you to access the SubscribeURL

C#

_logger.LogInformation(JsonConvert.SerializeObject(event));

nodejs

console.info(JSON.stringify(event, null, 2))
  • Identify the endpoint of the SubscribeURL within the logged event
  • Manually access the SubscribeURL link in your web browser to confirm the subscription

huangapple
  • 本文由 发表于 2023年5月21日 20:57:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76300011.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定