Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SNS publishing to multiple EC2 instances

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?

like image 412
smnbss Avatar asked Feb 21 '13 11:02

smnbss


1 Answers

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

like image 135
tster Avatar answered Dec 22 '22 01:12

tster