You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to determine if an error I'm seeing is caused by my code (most likely) or in the SNS code of this gem. I've got a working AWS::SNS::Client (I can list topics, etc), and I've added an new subscription via the web console with an HTTP endpoint. I've created a new AWS::SNS::Message from the body of the posted in confirmation, and when I try to use the lib to confirm the subscription I get this error:
Where c is the client, and a is the message, here is how i'm calling it:
>> c.confirm_subscription topic_arn: a.topic_arn, token: a.token
[AWS SNS 400 0.328125 0 retries] confirm_subscription(:token=>"23....8b65",:topic_arn=>"arn:aws:sns:us-west-1:3.....1:testing-jw") AWS::SNS::Errors::InvalidParameter Invalid parameter: Topic
AWS::SNS::Errors::InvalidParameter: Invalid parameter: Topic
from /Users/joshua/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.39.0/lib/aws/core/client.rb:374:in `return_or_raise'
from /Users/joshua/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.39.0/lib/aws/core/client.rb:475:in `client_request'
from (eval):3:in `confirm_subscription'
from (irb):30
Which seems correct from my reading of the docs. Has anyone else had problems confirming subscriptions in this way? I'd prefer to use this method rather than independently making an HTTP call to the message's subscription_url.
Ruby 2.1.1
aws-sdk gem 1.39.0
The text was updated successfully, but these errors were encountered:
Your stack trace indicates this error is being retuned from SNS and is not a client-side validation error. Given the message indicates the topic (or rather the topic arn) is invalid, my best guess is that you are connecting to one region and attmpeing to confirm a subscription to a topic in a different region.
You can verify this with the following:
# my guess at the cause of the error
c.config.sns_endpoint
#=> "sns.us-east-1.amazonaws.com"
If the endpoint returned has a different region than the topic arn that is likely the cause. The arn above indicates you are using us-west-1. The Ruby v1 SDK defaults to us-east-1. You would need to create the client with the appropriate region (you may need to extract this region from the arn):
Thank you, I think that was it exactly. What confused me was that I was able to list topics and saw the right number. Turns out I have two topics in us-east-1 that I'd never really used myself (SES related, and billing alerts) and it coincidentally matched the number in us-west-1. When I configured the client properly it all worked.
I'm trying to determine if an error I'm seeing is caused by my code (most likely) or in the SNS code of this gem. I've got a working AWS::SNS::Client (I can list topics, etc), and I've added an new subscription via the web console with an HTTP endpoint. I've created a new AWS::SNS::Message from the body of the posted in confirmation, and when I try to use the lib to confirm the subscription I get this error:
Where
c
is the client, anda
is the message, here is how i'm calling it:Which seems correct from my reading of the docs. Has anyone else had problems confirming subscriptions in this way? I'd prefer to use this method rather than independently making an HTTP call to the message's subscription_url.
Ruby 2.1.1
aws-sdk gem 1.39.0
The text was updated successfully, but these errors were encountered: