Reputation: 178
I've created a SNS Topic and a rest service running on EC2 instance. I came to know that if we need the HTTP endpoint to be subscribed to the SNS topic must me a public exposed endpoint.
But in my case, the rest service is running inside the AWS itself. So does this requirement applies in my case as well? or is it possible to use my rest service endpoint to subscribe?
Upvotes: 0
Views: 754
Reputation: 269081
From 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.
You will need to create a subscription on the Amazon SNS topic pointing to your application endpoint. The application endpoint will need to be accessible from the Internet (which is where Amazon SNS is connected). Thus, you will need to expose the endpoint on the instance and make it accessible through security groups to the Internet.
Upvotes: 3