Question

when I try to subscribe an http endpoint from an EC2 instance to an SNS topic, I get the following message:

"Not authorized to subscribe internal endpoints"

Is there any workaround for this? What is the best way to implement a pub/sub mechanism in AWS?

Was it helpful?

Solution

This means you have used the private IP instead of the public IP.

The easiest way to solve this is to log in to the AWS Console for EC2 (https://console.aws.amazon.com/ec2). Then click on the instance and you can see it has both a public and a private DNS. You want to use the public one.

To get this information programmatically from an instance you can do this on the instance: curl -s http://169.254.169.254/2009-04-04/meta-data/public-hostname. This is documented here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top