我可以将托管在 EC2 中的休息服务用作 SNS HTTP 订阅吗?

Can I use the rest service hosted in EC2 as a SNS HTTP subscription?

我在 EC2 实例上创建了一个 SNS 主题和一个休息服务 运行。我开始知道,如果我们需要 HTTP 端点订阅 SNS 主题,我必须 public 公开端点。

但就我而言,其余服务 运行 在 AWS 内部。那么这个要求是否也适用于我的情况?或者是否可以使用我的休息服务端点进行订阅?

来自Subscribe to a Topic - Amazon Simple Notification Service

To receive messages published to a topic, you have to subscribe an endpoint to that topic. An endpoint is a mobile app, web server, email address, or an Amazon SQS queue that can receive notification messages from Amazon SNS. Once you subscribe an endpoint to a topic and the subscription is confirmed, the endpoint will receive all messages published to that topic.

您需要在指向您的应用程序端点的 Amazon SNS 主题上创建一个订阅。应用程序端点需要 可从 Internet 访问(连接 Amazon SNS 的地方)。因此,您需要在实例上公开端点并使其可通过安全组访问 Internet。