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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With