I am publishing a message to and AWS SNS topic from a Rails 3 application using the AWS SDK for Ruby as below:
sns = AWS::SNS.new
topic = sns.topics['arn:aws:sns:eu-west-1:55555555555:my_topic']
topic.publish("MESSAGE", :subject => "SUBJECT")
When I publish to a topic in "us-east-1" it works as expected, but publishing to a topic in region "eu-west-1" does not work throwing:
AWS::SNS::Errors::InvalidParameter - Invalid parameter: TopicArn:
With the AWS SDK for Java set the region when creating the client object. Is there a similar way to set the region with the AWS SDK for Ruby?
Amazon SNS supports cross-region deliveries, both for Regions that are enabled by default and for opt-in Regions.
To publish messages to Amazon SNS topics using the AWS Management Console. Sign in to the Amazon SNS console . In the left navigation pane, choose Topics. On the Topics page, select a topic, and then choose Publish message.
The AWS Lambda function receives the message as an input parameter. It can manipulate the information in the message, publish the message to other Amazon SNS topics, or send the message to other AWS services. Log in to your AWS account and go to the Amazon SNS console.
Sending Amazon SNS messages to an Amazon SQS queue in a different account. You can publish a notification to an Amazon SNS topic with one or more subscriptions to Amazon SQS queues in another account.
Yes, in your AWS config which you can either pass in with your config intializer script
:region => 'eu-west-1'
Or create it in a file with your accesskey etc and pass the whole file in when newing up your api client
sns = AWS::SNS.new configFile
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